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

templates(cloudflare-pages,cloudflare-workers): adjust serverConditions #6832

Merged
merged 2 commits into from
Jul 17, 2023
Merged

Conversation

reichhartd
Copy link
Contributor

The change for the serverConditions of the templates of cloudflare-pages and cloudflare-workers was mentioned here by @huw:

Unfortunately, however, this was not addressed. Therefore I would like to have clarity whether it is recommended to adjust the serverConditions or to leave them at worker.

I think this should be ["workerd", "worker", "browser"]:

  • workerd is the new standard for Cloudflare Workers and could have slightly different code, usually optimised for edge runtimes. This is being adopted by React with a different bundle from their browser bundle.
  • worker should remain, because it’ll usually work and rely on less code than the browser bundle.
  • browser lets us fall back to browser code in packages that don’t have one of the other builds. Anecdotally, some of my code breaks without adding this condition. I’d argue this is more likely to happen than the inverse (a user imports a code that relies on browser-specific globals that Workers doesn’t have).

from #6229 (comment)

@changeset-bot
Copy link

changeset-bot bot commented Jul 14, 2023

⚠️ No Changeset found

Latest commit: e56d3cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@MichaelDeBoey MichaelDeBoey changed the title Templates: Adjust serverConditions for cloudflare-pages and cloudflare-workers templates(cloudflare-pages,cloudflare-workers): adjust serverConditions Jul 15, 2023
@brophdawg11 brophdawg11 merged commit 45b5359 into remix-run:main Jul 17, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants