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(cloudflare-pages): rewrite with module syntax #1004

Merged
merged 10 commits into from
Mar 3, 2023
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 1, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR introduces several improvements to the (currently experimental) cloudflare pages preset using module syntax and advanced mode _worker.js output.

While testing, I noticed zero-configs is broken with dist link (it was only supported for Nuxt also since it was doing dist symlinking and has it as default in CF pages). New output used top-level dist instead of .output/public also making it more consistent with their other FW presets. This is a slightly breaking change for the experimental preset if .output/public was hardcoded should be changed to dist

Next steps: Supporting _redirects and _headers

Also new in this preset: We use local fetch to directly generate response. it should make normalization more consistent in single place (in unenv

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #1004 (dc27eb9) into main (c4fcbb1) will decrease coverage by 0.11%.
The diff coverage is 85.56%.

@@            Coverage Diff             @@
##             main    #1004      +/-   ##
==========================================
- Coverage   67.69%   67.59%   -0.11%     
==========================================
  Files          60       61       +1     
  Lines        6167     6171       +4     
  Branches      692      693       +1     
==========================================
- Hits         4175     4171       -4     
- Misses       1982     1989       +7     
- Partials       10       11       +1     
Impacted Files Coverage Ξ”
src/presets/cloudflare-pages.ts 85.26% <85.26%> (ΓΈ)
src/presets/cloudflare.ts 80.00% <100.00%> (-7.18%) ⬇️
src/presets/index.ts 100.00% <100.00%> (ΓΈ)
src/rollup/config.ts 87.44% <0.00%> (-0.89%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0
Copy link
Member Author

pi0 commented Mar 3, 2023

Waiting for CI

image

@pi0 pi0 merged commit c578df8 into main Mar 3, 2023
@pi0 pi0 deleted the feat/cf-pages-rewrite branch March 3, 2023 22:33
@altryne
Copy link

altryne commented Mar 13, 2023

Will this now enable folks who use the regular cloudflare preset to also get access to cloudflare ENV and bindings? πŸ™

@dario-piotrowicz
Copy link
Contributor

@altryne yes if you use the pages adaptor, I don't think the improvement has been applied on the worker one (as you can see from #1054)

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.

3 participants