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

Dedicated wrangler preset #262

Open
pi0 opened this issue Jun 18, 2024 · 4 comments
Open

Dedicated wrangler preset #262

pi0 opened this issue Jun 18, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Jun 18, 2024

We have introduced a new cloudflare preset and set of $cloudflare polyfill variations set by this preset to allow leveraging hybrid Node.js compatibility available in workerd runtime.

Initially, cloudflare preset was introduced to be included in Nitro (rollup based) and we are working with cloudflare team to also integrate unenv into wrangler tooling (esbuild based)

Apart from bundler subtle differences (rollup and esbuild), from discussions like #257 i can predict in the future, we might have legit reasons that Nitro and Wrangler might need different ways of adding Cloudflare polyfills.

One way is to expose standard plugin (~> #263) but still decisions might vary on tool level between wrangler and Nitro objectives.

I propose to introduce a new wrangler preset ahead of time (maintained by @IgorMinar @jculvey as well) to allow forward-compatible way to collaborate releases between unenv and wrangler without imposing unwanted changes to the end users.

@IgorMinar
Copy link
Collaborator

I'll think about this more, but I'd really like to avoid wrangler specific preset. The hybrid polyfill we implemented relies on aligning versions of workerd and unenv and this will become much harder to reason about if we in addition to this also have to think about two different presets.

@pi0
Copy link
Member Author

pi0 commented Jun 18, 2024

I also wish minimum possible variations and wrangler preset (extending cloudflare > nodeless) to be as empty as possible.

My intention is not to duplicate efforts but have a safe space that we can put wrangler-specific requirements. For example injection for global Performance polyfills with Node.js addons.

(i might have better idea for configurable presets to avoid additional one but the gist of idea will be same: a way to cerianly know if we are exporting preset for wrangler or nitro and with or without Node global API)

@Dmytro-Tihunov

This comment was marked as off-topic.

@pi0

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants