-
Notifications
You must be signed in to change notification settings - Fork 353
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
feat(plugin-runtime): support ssr inline assets #4735
Conversation
🦋 Changeset detectedLatest commit: ae8b99a The changes in this PR will be included in the next version bump. This PR includes changesets to release 258 packages
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 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4735 +/- ##
==========================================
- Coverage 57.59% 50.66% -6.94%
==========================================
Files 672 692 +20
Lines 17794 19293 +1499
Branches 3876 4461 +585
==========================================
- Hits 10249 9775 -474
- Misses 6934 8770 +1836
- Partials 611 748 +137 ☔ View full report in Codecov by Sentry. |
c1d64d5
to
68a4090
Compare
Base branch was modified
feat: optimize github workflow config (#4826) chore: use self host for type-checker (#4827) feat: release action trigger rsbuild update-modern workflow (#4828) fix: export reporter only in middlewares-context (#4562) feat: update rspress version (#4821) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: neverland <chenjiahan.jait@bytedance.com> chore(module-tools): add comment for resolve false in browser alias (#4818) docs: fix broken dicebear avatar api url (#4835) feat: add storybook framework (#4585) fix: modify the generated routes code, compatible with loadable and swc (#4833) chore(storybook): fix version, files and license (#4836) fix(storybook-builder): add missing files (#4837) feat: optimize generator bundle (#4838) feat(plugin-runtime): support ssr inline assets (#4735) feat: upgrade generator support handle special package (#4839) fix(module-tools): update umd global code (#4825) fix(plugin-testing): failed to run tests with decorators (#4840) fix(module-pluginnode-polyfill): no bundle globals.js (#4841)
Summary
🤖 Generated by Copilot at 20fbd9e
This pull request adds a new feature to the
@modern-js/runtime
package that allows inlining some script and style assets in the HTML output for SSR rendering. It modifies theSSRPluginConfig
type, thessrPlugin
andrenderToString
functions, and theRenderToString
andRender
classes to support the feature. It also adds a test case for the feature in thetests/integration/ssr
folder, using a fixture app with some configuration options and components. It updates the.changeset
folder with a markdown file that describes the changes and the version update.Details
🤖 Generated by Copilot at 20fbd9e
.changeset
folder with the changelog and version information for the@modern-js/runtime
package (link)SSRPluginConfig
type (link)config.output
object and pass them to therenderToString
function in thessrPlugin
function (link, link)routeManifest
property to store the route assets information in theRenderToString
class (link, link)renderToString
andrender
methods of theRenderToString
class to return promises instead of strings and addawait
keywords before the asynchronous function calls (link, link, link, link)routeManifest
property to thecreateLoadableCollector
function in therenderToString
method of theRenderToString
class (link)loadable.ts
file (link, link)effect
method of theLoadableCollector
class to return a promise and replace the original logic of emitting the loadable assets with two separate methods for emitting the script and style assets (link, link)generateAttributes
method of theLoadableCollector
class (link)LoadableCollectorOptions
interface (link)effect
method of theCollector
interface and thefinish
method of theRender
class to return promises and usePromise.all
to wait for the collectors' effects in therender.ts
file (link, link, link)Related Issue
Checklist
pnpm run change
.