Skip to content

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

Merged
pi0 merged 2 commits intomainfrom
refactor/legacy-polyfills
Aug 26, 2023
Merged

refactor: use native Headers and Response for legacy polyfills#523
pi0 merged 2 commits intomainfrom
refactor/legacy-polyfills

Conversation

@pi0
Copy link
Copy Markdown
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
Copy Markdown

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