@stackframe/stack-sc 2.6.19 → 2.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { cookies, headers } from 'next/headers';
|
|
2
1
|
export declare const isReactServer = true;
|
|
2
|
+
import { cookies as nextCookies, headers as nextHeaders } from './next-static-analysis-workaround';
|
|
3
|
+
export declare const cookies: typeof nextCookies | (() => Promise<ReturnType<typeof nextCookies>>);
|
|
4
|
+
export declare const headers: typeof nextHeaders | (() => Promise<ReturnType<typeof nextHeaders>>);
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export { cookies, headers } from 'next/headers';
|
|
2
1
|
export const isReactServer = true;
|
|
2
|
+
// In Next.js 15, the `next/headers` module returns async functions.
|
|
3
|
+
// Since we support both Next.js 14 and 15, we return a union of the two.
|
|
4
|
+
// TODO: Remove this once we drop support for Next.js 14, and replace it with `export { cookies, headers } from 'next/headers';`
|
|
5
|
+
// https://nextjs.org/blog/next-15#async-request-apis-breaking-change
|
|
6
|
+
import { cookies as nextCookies, headers as nextHeaders } from './next-static-analysis-workaround';
|
|
7
|
+
export const cookies = nextCookies;
|
|
8
|
+
export const headers = nextHeaders;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'next/headers';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Next statically analyzes the imports and ensures that the `next/headers` module is never imported on a client bundle.
|
|
2
|
+
//
|
|
3
|
+
// We know what we're doing though. We ensure at runtime that we never use the module unless we're on the server, so the
|
|
4
|
+
// static analysis is wrong.
|
|
5
|
+
//
|
|
6
|
+
// Fortunately, as a hack, we can get around it by importing them using the `export from` syntax, which the static
|
|
7
|
+
// analyzer does not detect, but Webpack is fine with it.
|
|
8
|
+
//
|
|
9
|
+
// So, we can use the export syntax here, and then import them normally in the main file.
|
|
10
|
+
export * from 'next/headers';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackframe/stack-sc",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.21",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./force-react-server": {
|
|
6
6
|
"types": "./dist/index.react-server.d.ts",
|
|
@@ -24,13 +24,24 @@
|
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"next": ">=14.1",
|
|
27
|
-
"react": ">=18.2"
|
|
27
|
+
"react": ">=18.2",
|
|
28
|
+
"react-dom": ">=18.2",
|
|
29
|
+
"@types/react": ">=18.3.12",
|
|
30
|
+
"@types/react-dom": ">=18.3.1"
|
|
31
|
+
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"@types/react": {
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
"@types/react-dom": {
|
|
37
|
+
"optional": true
|
|
38
|
+
}
|
|
28
39
|
},
|
|
29
40
|
"devDependencies": {
|
|
30
41
|
"rimraf": "^5.0.5",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
42
|
+
"react": "^18.2",
|
|
43
|
+
"react-dom": "^18.2",
|
|
44
|
+
"next": "^14.1.0"
|
|
34
45
|
},
|
|
35
46
|
"scripts": {
|
|
36
47
|
"build": "tsc",
|