-
Notifications
You must be signed in to change notification settings - Fork 553
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
check for an implementation of AsyncLocalStorage #866
Conversation
🦋 Changeset detectedLatest commit: 22d59ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2247677395/npm-package-wrangler-866 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/866/npm-package-wrangler-866 Or you can use npx https://prerelease-registry.developers.workers.dev/runs/2247677395/npm-package-wrangler-866 dev path/to/script.js |
I didn't write any tests for this since the functionality is behind |
Workers project Pages project |
For clarity: the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me!! Another big step in Wrangler support in atypical environments.
🥳🥳🥳
Thanks for this PR 🙏 🙏 🙏 @caass We are working on git or url dependencies so hopefully that will work soonish. |
Certain runtime APIs are only available to workers during the "request context", which is any code that returns after receiving a request and before returning a response.
Miniflare emulates this behavior by using an
AsyncLocalStorage
and checking at runtime to see if you're using those APIs during the request context.In certain environments
AsyncLocalStorage
is unavailable, such as in a webcontainer. This function figures out if we're able to run those "request context" checks and returns a set of options that indicate to miniflare whether to run the checks or not.Closes #863