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

[miniflare] fix: remove __STATIC_CONTENT_MANIFEST from module worker env #4505

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Nov 24, 2023

Fixes #4374.

What this PR solves / how to test:

When using Workers Sites with a module worker, the asset manifest must be imported from the __STATIC_CONTENT_MANIFEST virtual module. Miniflare provided this module, but also erroneously added __STATIC_CONTENT_MANIFEST to the env object too. Whilst this didn't break anything locally, it could cause users to develop Workers that ran locally, but not when deployed. This change ensures env doesn't contain __STATIC_CONTENT_MANIFEST.

To test this, run wrangler dev in fixtures/sites-app and verify __STATIC_CONTENT_MANIFEST doesn't appear in the env object.

Author has addressed the following:

  • Tests
    • Included
    • Not necessary because:
  • Changeset (Changeset guidelines)
    • Included
    • Not necessary because:
  • Associated docs
    • Issue(s)/PR(s):
    • Not necessary because: this was erroneous local only behaviour

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@mrbbot mrbbot requested a review from a team as a code owner November 24, 2023 10:41
Copy link

changeset-bot bot commented Nov 24, 2023

🦋 Changeset detected

Latest commit: fc8043a

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

This PR includes changesets to release 3 packages
Name Type
miniflare Patch
@cloudflare/pages-shared Patch
wrangler Patch

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

@mrbbot mrbbot changed the title fix: remove __STATIC_CONTENT_MANIFEST from module worker env [miniflare] fix: remove __STATIC_CONTENT_MANIFEST from module worker env Nov 24, 2023
Copy link
Contributor

github-actions bot commented Nov 24, 2023

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/7004078380/npm-package-wrangler-4505

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7004078380/npm-package-wrangler-4505 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7004078380/npm-package-miniflare-4505
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7004078380/npm-package-cloudflare-pages-shared-4505

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


wrangler@3.17.1 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20231030.1
workerd 1.20231030.0 1.20231030.0
workerd --version 1.20231030.0 2023-10-30

|

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

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #4505 (fc8043a) into main (d79a68f) will increase coverage by 0.03%.
Report is 7 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4505      +/-   ##
==========================================
+ Coverage   75.44%   75.47%   +0.03%     
==========================================
  Files         240      240              
  Lines       12851    12851              
  Branches     3309     3309              
==========================================
+ Hits         9695     9699       +4     
+ Misses       3156     3152       -4     

see 3 files with indirect coverage changes

@mrbbot mrbbot force-pushed the bcoll/workers-sites-remove-from-modules-env branch from eb64010 to fc8043a Compare November 27, 2023 11:03
@mrbbot mrbbot merged commit 1b34878 into main Nov 27, 2023
17 checks passed
@mrbbot mrbbot deleted the bcoll/workers-sites-remove-from-modules-env branch November 27, 2023 14:10
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.

[Miniflare] __STATIC_CONTENT_MANIFEST should not be available on the environment for Module Workers
2 participants