-
Notifications
You must be signed in to change notification settings - Fork 83
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
Improve bundle size with reader API in React server component environments #618
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 35ff750 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
b4d0f5e
to
70baea7
Compare
70baea7
to
2e2c9f7
Compare
"react-server": "./src/form/fields/document/DocumentEditor/primitives/blank-for-react-server.tsx", | ||
"default": "./src/form/fields/document/DocumentEditor/primitives/index.tsx" | ||
}, | ||
"#cloud-image-preview": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels ... moderately unsustainable, if we end up with many more component blocks? could/should we organise this differently, like have an component-blocks
import? or is this just private API and it doesn't matter, we can refactor it later if that's an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this just private API and it doesn't matter, we can refactor it later if that's an issue?
This, all of the imports
field is entirely private
Fixes #453
Fixes #601
This replaces
'use client'
s in UI modules imported by code that's needed for the reader API with using thepackage.json#imports
field to map those UI modules to empty implementations inreact-server
environments so that Next will never bundle those UI modules into pages using the reader APIAs an example of the improvement, in the
dev-projects/next-app
, using the reader API made the first load JS600 kB
, after these changes, it's77.7 kB
which seems to be the baseline with Next. (testing with the customNote
component block that's there disabled in both cases)