Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOM] disallow client entrypoints with react-server condition #28784

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/react-dom/npm/client.react-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

throw new Error(
'react-dom/client is not supported in React Server Components.'
);
5 changes: 5 additions & 0 deletions packages/react-dom/npm/profiling.react-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

throw new Error(
'react-dom/profiling is not supported in React Server Components.'
);
5 changes: 5 additions & 0 deletions packages/react-dom/npm/server.react-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

throw new Error(
'react-dom/server is not supported in React Server Components.'
);
5 changes: 5 additions & 0 deletions packages/react-dom/npm/static.react-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

throw new Error(
'react-dom/static is not supported in React Server Components.'
);
5 changes: 5 additions & 0 deletions packages/react-dom/npm/unstable_testing.react-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

throw new Error(
'react-dom/unstable_testing is not supported in React Server Components.'
);
52 changes: 42 additions & 10 deletions packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@
"react-server": "./react-dom.react-server.js",
"default": "./index.js"
},
"./client": "./client.js",
"./client": {
"react-server": "./client.react-server.js",
"default": "./client.js"
},
"./server": {
"react-server": "./server.react-server.js",
"workerd": "./server.edge.js",
"bun": "./server.bun.js",
"deno": "./server.browser.js",
Expand All @@ -61,11 +65,24 @@
"edge-light": "./server.edge.js",
"default": "./server.node.js"
},
"./server.browser": "./server.browser.js",
"./server.bun": "./server.bun.js",
"./server.edge": "./server.edge.js",
"./server.node": "./server.node.js",
"./server.browser": {
"react-server": "./server.react-server.js",
"default": "./server.browser.js"
},
"./server.bun": {
"react-server": "./server.react-server.js",
"default": "./server.bun.js"
},
"./server.edge": {
"react-server": "./server.react-server.js",
"default": "./server.edge.js"
},
"./server.node": {
"react-server": "./server.react-server.js",
"default": "./server.node.js"
},
"./static": {
"react-server": "./static.react-server.js",
"workerd": "./static.edge.js",
"deno": "./static.browser.js",
"worker": "./static.browser.js",
Expand All @@ -74,13 +91,28 @@
"edge-light": "./static.edge.js",
"default": "./static.node.js"
},
"./static.browser": "./static.browser.js",
"./static.edge": "./static.edge.js",
"./static.node": "./static.node.js",
"./static.browser": {
"react-server": "./static.react-server.js",
"default": "./static.browser.js"
},
"./static.edge": {
"react-server": "./static.react-server.js",
"default": "./static.edge.js"
},
"./static.node": {
"react-server": "./static.react-server.js",
"default": "./static.node.js"
},
"./server-rendering-stub": "./server-rendering-stub.js",
"./profiling": "./profiling.js",
"./profiling": {
"react-server": "./profiling.react-server.js",
"default": "./profiling.js"
},
"./test-utils": "./test-utils.js",
"./unstable_testing": "./unstable_testing.js",
"./unstable_testing": {
"react-server": "./unstable_testing.react-server.js",
"default": "./unstable_testing.js"
},
"./unstable_server-external-runtime": "./unstable_server-external-runtime.js",
"./src/*": "./src/*",
"./package.json": "./package.json"
Expand Down