Skip to content

Conversation

@anonrig
Copy link
Member

@anonrig anonrig commented Jan 21, 2025

We currently implement node:timers and node:net in cloudflare workers. I've opened a similar PR to unenv as well: unjs/unenv#396


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: we already have ones that cover it through E2E
  • Public documentation

@anonrig anonrig requested review from a team as code owners January 21, 2025 20:51
@anonrig anonrig requested a review from IgorMinar January 21, 2025 20:51
@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2025

🦋 Changeset detected

Latest commit: ee8d022

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/unenv-preset Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@anonrig anonrig requested a review from vicb January 21, 2025 20:54
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, I had missed this one.

Looks like there might some formatting issue? Diff doesn't looks good for me.

Could you please add tests and bump the workerd peer dependency in package.json when the timers fix is released.

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-wrangler-7853

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7853/npm-package-wrangler-7853

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-wrangler-7853 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-workers-bindings-extension-7853 -O ./cloudflare-workers-bindings-extension.0.0.0-v06f5e7c24.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v06f5e7c24.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-create-cloudflare-7853 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-kv-asset-handler-7853

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-miniflare-7853

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-pages-shared-7853

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-unenv-preset-7853

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-vite-plugin-7853

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-vitest-pool-workers-7853

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-workers-editor-shared-7853

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-workers-shared-7853

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12963384408/npm-package-cloudflare-workflows-shared-7853

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250124.0
workerd 1.20250124.0 1.20250124.0
workerd --version 1.20250124.0 2025-01-24

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@anonrig anonrig force-pushed the yagiz/update-unenv-preset branch from 28acd05 to 590b148 Compare January 24, 2025 17:20
@anonrig anonrig requested review from jasnell and vicb January 24, 2025 17:22
@anonrig
Copy link
Member Author

anonrig commented Jan 24, 2025

This is ready to land @vicb. Can you re-review?

@anonrig anonrig force-pushed the yagiz/update-unenv-preset branch 4 times, most recently from d9ee188 to 43b62b6 Compare January 24, 2025 17:36
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🙂

@anonrig anonrig force-pushed the yagiz/update-unenv-preset branch from e0375c0 to 017e5ba Compare January 24, 2025 19:10
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yagiz, I'll merge the 2 changesets

@vicb vicb self-requested a review January 24, 2025 20:10
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anonrig I merged the changesets and changed to minor over patch.

Also added a basic timers/promises test

@anonrig anonrig changed the title add node:timers and node:util to unenv-preset add node:timers and node:net to unenv-preset Jan 24, 2025
@vicb vicb force-pushed the yagiz/update-unenv-preset branch from f1c1637 to ee8d022 Compare January 25, 2025 08:29
@vicb vicb self-requested a review January 27, 2025 14:02
@petebacondarwin petebacondarwin merged commit 061587d into main Jan 27, 2025
32 checks passed
@petebacondarwin petebacondarwin deleted the yagiz/update-unenv-preset branch January 27, 2025 14:20
@vicb
Copy link
Contributor

vicb commented Jan 27, 2025

Thanks Pete!

dario-piotrowicz added a commit that referenced this pull request Jan 27, 2025
* add node:timers and node:util to unenv-preset

* update unenv to 2.0.0-rc.1

* Update .changeset/popular-pigs-glow.md

Co-authored-by: Dario Piotrowicz <[email protected]>

* fixup!

* fixup! format

* fixup! update module tests

---------

Co-authored-by: Victor Berchet <[email protected]>
Co-authored-by: Dario Piotrowicz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants