Skip to content

Commit 697736a

Browse files
committed
ref: Move all other server exports under a single (explicit) path
1 parent 8d07519 commit 697736a

9 files changed

+44
-26
lines changed

packages/nuqs/package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,9 @@
6868
"import": "./dist/server/cache.js",
6969
"require": "./esm-only.cjs"
7070
},
71-
"./server/serializer": {
72-
"types": "./dist/server/serializer.d.ts",
73-
"import": "./dist/server/serializer.js",
74-
"require": "./esm-only.cjs"
75-
},
76-
"./server/parsers": {
77-
"types": "./dist/server/parsers.d.ts",
78-
"import": "./dist/server/parsers.js",
71+
"./server/temporary-react-agnostic": {
72+
"types": "./dist/server/temporary-react-agnostic.d.ts",
73+
"import": "./dist/server/temporary-react-agnostic.js",
7974
"require": "./esm-only.cjs"
8075
},
8176
"./adapters/react": {

packages/nuqs/server/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Why just the cache here?
33
Those "top-level" .d.ts files are used to help projects with `moduleResolution: 'node'`
44
resolve the correct imports.
55

6-
The other two imports under server, `nuqs/server/parsers` and `nuqs/server/serializer`
7-
are temporary and will be removed in nuqs@3.0.0.
6+
The other import under server, `nuqs/server/temporary-react-agnostic`
7+
is temporary (as it says on the tin) and will be removed in nuqs@3.0.0.
88

99
Also, nuqs@3.0.0 will require a `moduleResolution: 'bundler' | 'nodeNext` setting in your tsconfig.json.
-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export { createSearchParamsCache } from './cache'
2-
export type { HistoryOptions, Nullable, Options, SearchParams } from './defs'

packages/nuqs/src/index.server.parsers.ts

-2
This file was deleted.

packages/nuqs/src/index.server.serializer.ts

-2
This file was deleted.

packages/nuqs/src/index.server.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
/** @deprecated Import createSearchParamsCache from 'nuqs/server/cache' instead.
2-
*
3-
* This export will be removed from 'nuqs/server' in nuqs@3.0.0,
4-
* to allow non-Next.js server code to use the parsers, serializeres and other
5-
* server-side utilities without depending on React canary for the `cache` function.
6-
*/
7-
export { createSearchParamsCache } from './cache'
8-
export type { HistoryOptions, Nullable, Options, SearchParams } from './defs'
1+
export {
2+
/** @deprecated Import createSearchParamsCache from 'nuqs/server/cache' instead.
3+
*
4+
* This export will be removed from 'nuqs/server' in nuqs@3.0.0,
5+
* to allow non-Next.js server code to use the parsers, serializeres and other
6+
* server-side utilities without depending on React canary for the `cache` function.
7+
*/
8+
createSearchParamsCache
9+
} from './cache'
10+
export type {
11+
HistoryOptions,
12+
Nullable,
13+
Options,
14+
SearchParams,
15+
UrlKeys
16+
} from './defs'
917
export {
1018
createLoader,
1119
type LoaderFunction,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export type {
2+
HistoryOptions,
3+
Nullable,
4+
Options,
5+
SearchParams,
6+
UrlKeys
7+
} from './defs'
8+
export {
9+
createLoader,
10+
type LoaderFunction,
11+
type LoaderInput,
12+
type LoaderOptions
13+
} from './loader'
14+
export * from './parsers'
15+
export { createSerializer } from './serializer'

packages/nuqs/src/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
export type { HistoryOptions, Nullable, Options, SearchParams } from './defs'
1+
export type {
2+
HistoryOptions,
3+
Nullable,
4+
Options,
5+
SearchParams,
6+
UrlKeys
7+
} from './defs'
28
export {
39
createLoader,
410
type LoaderFunction,

packages/nuqs/tsup.config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ const entrypoints = {
3636
server: {
3737
server: 'src/index.server.ts',
3838
'server/cache': 'src/index.server.cache.ts',
39-
'server/parsers': 'src/index.server.parsers.ts',
40-
'server/serializer': 'src/index.server.serializer.ts'
39+
'server/temporary-react-agnostic': 'src/index.temporary-react-agnostic.ts'
4140
}
4241
}
4342

0 commit comments

Comments
 (0)