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

Fix prerendered page handling on Deno #6284

Merged
merged 8 commits into from
Feb 17, 2023
Merged

Fix prerendered page handling on Deno #6284

merged 8 commits into from
Feb 17, 2023

Conversation

natemoo-re
Copy link
Member

@natemoo-re natemoo-re commented Feb 17, 2023

Changes

  • Follow-up to Revert "Deno fix #6131 (#6248)" #6281, Deno fix #6131 #6248
  • Deno fix #6131 #6248 was reverted because it special-cased Deno in core and caused some issues in practice.
  • This PR takes a different approach by providing a shim for Deno-specific imports in Node so that pages can be prerendered, then replacing that shim with the actual Deno imports for the production server.
  • Also switches to Deno's std serveFile function which can serve the file without loading the file into memory for optimal performance 🔥

Testing

Test added

Docs

N/A, bug fix only

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2023

🦋 Changeset detected

Latest commit: 65791ea

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

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope) labels Feb 17, 2023
@matthewp matthewp merged commit 61113dd into main Feb 17, 2023
@matthewp matthewp deleted the fix/deno-prerender-ii branch February 17, 2023 18:19
@astrobot-houston astrobot-houston mentioned this pull request Feb 17, 2023
liruifengv pushed a commit to liruifengv/astro that referenced this pull request Feb 18, 2023
* fix(deno): handle prerendered pages

* test(deno): add prerender test

* fix: defensively access vite.build.rollupOptions.external

* fix(deno): support other formats of rollupOptions.external

* fix(deno): crawl prerendered files for match

* fix(deno): ignore deno error in server file

* fix(deno): cross-platform serve file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants