next.js
6599f1dc - provide declarations for server-only/client-only (#80361)

Commit
225 days ago
provide declarations for server-only/client-only (#80361) We implement the behavior of `import 'server-only'` and `import 'client-only'` on the compiler level and thus don't require having them installed as dependencies. By default it works fine with typescript, because (surprisingly) TSC *doesn't check side-effecting imports*. But this behavior can be overridden with [`noUncheckedSideEffectImports`](https://www.typescriptlang.org/tsconfig/#noUncheckedSideEffectImports) which'd cause `import 'server-only'` to start erroring. To prevent that, we add declarations for them in next's global type declarations.
Author
Parents
Loading