[c3] fix: ensure the Angular fetch handler returns a "real" promise to Cloudflare#3516
Merged
petebacondarwin merged 1 commit intomainfrom Jun 25, 2023
Merged
[c3] fix: ensure the Angular fetch handler returns a "real" promise to Cloudflare#3516petebacondarwin merged 1 commit intomainfrom
petebacondarwin merged 1 commit intomainfrom
Conversation
…o Cloudflare Angular employs the Zone.js library to patch potentially async operations so that it can trigger change detection reliably. But in order to do this, it swaps out the native `Promise` with a `ZoneAwarePromise` class. The Cloudflare runtime (i.e. workerd) does runtime checks on the value returned from the `fetch()` handler, expecting it to be a native `Promise` and fails if not. This fix ensures that the actual object returned from the `fetch()` is actually a native `Promise`. We don't need to stop Angular using `ZoneAwarePromises` elsewhere.
🦋 Changeset detectedLatest commit: e15cb05 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 |
RamIdeas
approved these changes
Jun 23, 2023
Contributor
|
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/5356661752/npm-package-wrangler-3516You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/3516/npm-package-wrangler-3516Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5356661752/npm-package-wrangler-3516 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5356661752/npm-package-cloudflare-pages-shared-3516Note that these links will no longer work once the GitHub Actions artifact expires. |
jculvey
approved these changes
Jun 23, 2023
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Angular employs the Zone.js library to patch potentially async operations so that
it can trigger change detection reliably. But in order to do this, it swaps out
the native
Promisewith aZoneAwarePromiseclass.The Cloudflare runtime (i.e. workerd) does runtime checks on the value returned
from the
fetch()handler, expecting it to be a nativePromiseand fails if not.This fix ensures that the actual object returned from the
fetch()is actually anative
Promise. We don't need to stop Angular usingZoneAwarePromiseselsewhere.Fixes # [insert GH or internal issue number(s)].
What this PR solves / how to test:
Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable: