-
Notifications
You must be signed in to change notification settings - Fork 349
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
fix: lazy import preload, then update include.type to include.as #4589
Conversation
🦋 Changeset detectedLatest commit: 6bb0e46 The changes in this PR will be included in the next version bump. This PR includes changesets to release 253 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 ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #4589 +/- ##
==========================================
- Coverage 57.59% 54.07% -3.53%
==========================================
Files 672 652 -20
Lines 17794 17902 +108
Branches 3876 4128 +252
==========================================
- Hits 10249 9680 -569
- Misses 6934 7570 +636
- Partials 611 652 +41 ☔ View full report in Codecov by Sentry. |
Summary
unuse preload, but it would run some effect actions.
🤖 Generated by Copilot at 6bb0e46
This pull request improves and fixes the preload feature of the
@modern-js/prod-server
package, which allows the server to send preload hints to the browser for faster loading of resources. It changes the type definition, the file structure, and the import paths for the preload-related functions and types. It also updates the tests and the changelogs for the affected packages.Details
🤖 Generated by Copilot at 6bb0e46
@modern-js/prod-server
and@modern-js/server-core
packages (link)PreloadInclude
type to useas
instead oftype
for the preload links, and update theRoutes
type accordingly inpackages/server/core/src/types/config/server.ts
(link)shouldFlushServerHeader
function to a separate filepackages/server/prod-server/src/libs/preload/shouldFlushServerHeader.ts
to isolate the preload condition logic (link, link)shouldFlushServerHeader
function inpackages/server/prod-server/src/libs/preload/transformLinks2String.ts
andpackages/server/prod-server/src/libs/render/index.ts
to use the new file path (link, link)flushServerHeader
function inpackages/server/prod-server/src/libs/render/index.ts
to optimize the server loading time (link, link)addInclude
function and the test case inpackages/server/prod-server/src/libs/preload/transformLinks2String.ts
andpackages/server/prod-server/tests/preload.test.ts
to useas
instead oftype
for the preload links (link, link)tests/integration/ssr/fixtures/preload/modern.config.ts
to use theinclude
option and theas
property (link)Related Issue
Checklist
pnpm run change
.