10000 feat: upgrade unenv 1.x to 2.x by jcbsfilho · Pull Request #159 · aziontech/lib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: upgrade unenv 1.x to 2.x #159

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

Merged
merged 14 commits into from
May 5, 2025
Merged

feat: upgrade unenv 1.x to 2.x #159

merged 14 commits into from
May 5, 2025

Conversation

jcbsfilho
Copy link
Collaborator
@jcbsfilho jcbsfilho commented May 5, 2025

This pull request introduces several updates to dependencies, configuration changes for the ESBuild bundler, and new polyfills for Node.js modules like crypto, fs, promises, and stream. These changes enhance compatibility, improve maintainability, and ensure better support for Node.js features in browser environments.

Dependency Updates:

  • Updated the unenv dependency to version ^2.0.0-rc.15 in both package.json and packages/bundler/package.json to leverage the latest features and fixes. [1] [2]

ESBuild Configuration Enhancements:

  • Added keepNames and allowOverwrite options to the ESBuild configuration to improve bundling behavior.
  • Enhanced the applyContentInjection function to include a production-specific banner for ESBuild, ensuring compatibility with production builds.
  • Updated the createAzionESBuildConfig function to pass the ctx parameter to applyContentInjection, enabling context-aware configurations.

Polyfills for Node.js Features:

  • Added a comprehensive crypto polyfill, exposing various cryptographic methods and constants to emulate Node.js's crypto module in browser environments. [1] [2] [3] [4]
  • Introduced a new promises polyfill with a withResolvers utility for enhanced Promise handling. [1] [2] [3]
  • Implemented a stream polyfill, providing support for Readable, Writable, and other stream-related classes. [1] [2] [3]
  • Extended the fs polyfill to include the existsSync method, improving file system compatibility. [1] [2] [3] [4] [5] [6]

Node.js Polyfills Configuration:

  • Replaced env and nodeless imports from unenv with the new defineEnv API, enabling better control over polyfill behavior and compatibility. [1] [2]

These changes collectively enhance the bundler's capabilities and ensure compatibility with modern Node.js features in browser-based environments.

@jcbsfilho jcbsfilho changed the title feat: upgrade uenv 1.x to 2.x feat: upgrade unenv 1.x to 2.x May 5, 2025
jotanarciso
jotanarciso previously approved these changes May 5, 2025
@jcbsfilho jcbsfilho merged commit 60ef725 into stage May 5, 2025
2 checks passed
@jcbsfilho jcbsfilho deleted the proposal/unenv-v2 branch May 5, 2025 17:46
jotanarciso pushed a commit that referenced this pull request May 5, 2025
[skip ci]
## [1.20.0-stage.1](v1.19.1...v1.20.0-stage.1) (2025-05-05)

### Features

* upgrade unenv 1.x to 2.x (#159) ([60ef725](60ef725))
@jotanarciso
Copy link
Collaborator

🎉 This PR is included in version 1.20.0-stage.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants
0