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

feat: support disable pre-render #4571

Merged
merged 2 commits into from
Sep 6, 2023
Merged

Conversation

GiveMe-A-Name
Copy link
Member

@GiveMe-A-Name GiveMe-A-Name commented Sep 4, 2023

Summary

🤖 Generated by Copilot at 3852431

This pull request adds a new feature to the SSR plugin that allows the user to disable pre-rendering of SSR components to static HTML. It updates the prefetch function, the SSRPluginConfig and SSR types, and the modern.config.ts file to support the disablePrerender option. It also adds a changeset file and a test case for the feature.

Details

🤖 Generated by Copilot at 3852431

  • Add a changeset file to describe the features and the version bumps for the @modern-js/runtime and @modern-js/server-core packages (link)
  • Add a disablePrerender option to the SSR plugin configuration to support skipping the pre-rendering step in the SSR process (link, link, link)
  • Read the disablePrerender option from the config.server.ssr object in the cli/index.ts module (link)
  • Pass the disablePrerender option as an argument to the prefetch function in the prefetch.tsx module (link, link)
  • Check the disablePrerender option before calling the renderToStaticMarkup function in the prefetch.tsx module (link)
  • Modify the server.ssr field in the modern.config.ts file of the test fixture to test the disablePrerender option (link)

Related Issue

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Sep 4, 2023

🦋 Changeset detected

Latest commit: d5d64b2

The changes in this PR will be included in the next version bump.

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
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Patch coverage has no change and project coverage change: -3.77% ⚠️

Comparison is base (99693f0) 57.59% compared to head (d5d64b2) 53.83%.
Report is 1094 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4571      +/-   ##
==========================================
- Coverage   57.59%   53.83%   -3.77%     
==========================================
  Files         672      656      -16     
  Lines       17794    17986     +192     
  Branches     3876     4152     +276     
==========================================
- Hits        10249     9682     -567     
- Misses       6934     7648     +714     
- Partials      611      656      +45     

see 455 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GiveMe-A-Name GiveMe-A-Name merged commit dcdeea5 into main Sep 6, 2023
10 checks passed
@GiveMe-A-Name GiveMe-A-Name deleted the feat/disable-prerender branch September 6, 2023 06:28
@caohuilin caohuilin mentioned this pull request Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants