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

refactor: use native Headers and Response for legacy polyfills #523

Merged
merged 2 commits into from
Aug 26, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 26, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 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)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

In h3 1.8, we have changed to rely on native global Headers and Response objects.

To avoid breaking changes, we have kept the (unused) H3Headers and H3Response polyfills in case users by any chance were using them and introduce a breaking change to the exports.

Since objects like Headers are under development and h3 polyfills lacked many methods including toClone() i think it is just safer to redirect those to native globals as H3 (and Nuxt/Nitro) expect (and polyfill) them anyway and are available in recent versions of Node.js.

πŸ“ Checklist

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

@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #523 (8401635) into main (706f73f) will increase coverage by 1.58%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head 8401635 differs from pull request most recent head 1fb8108. Consider uploading reports for the commit 1fb8108 to get more accurate results

@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
+ Coverage   82.15%   83.73%   +1.58%     
==========================================
  Files          32       31       -1     
  Lines        3665     3542     -123     
  Branches      540      540              
==========================================
- Hits         3011     2966      -45     
+ Misses        654      576      -78     
Files Changed Coverage Ξ”
src/event/_polyfills.ts 100.00% <100.00%> (ΓΈ)
src/event/index.ts 100.00% <100.00%> (ΓΈ)

@pi0 pi0 merged commit e21d6ee into main Aug 26, 2023
@pi0 pi0 deleted the refactor/legacy-polyfills branch August 26, 2023 19:51
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.

1 participant