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

chore: add env and ctx params to fetch in javascript example template #1943

Merged
merged 2 commits into from Sep 28, 2022

Conversation

cameron-robey
Copy link
Contributor

Just like in the typescript templates, and the javascript template for scheduled workers, we include env and ctx as parameters to the fetch export. This makes it clearer where environment variables live.

Closes #1942

@changeset-bot
Copy link

changeset-bot bot commented Sep 28, 2022

🦋 Changeset detected

Latest commit: 246017d

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

This PR includes changesets to release 1 package
Name Type
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

@github-actions
Copy link
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.developers.workers.dev/runs/3142974469/npm-package-wrangler-1943

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1943/npm-package-wrangler-1943

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/3142974469/npm-package-wrangler-1943 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.developers.workers.dev/runs/3142974469/npm-package-cloudflare-pages-shared-1943

@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Merging #1943 (246017d) into main (5854cb6) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1943      +/-   ##
==========================================
+ Coverage   75.10%   75.11%   +0.01%     
==========================================
  Files         116      116              
  Lines        7929     7929              
  Branches     2065     2065              
==========================================
+ Hits         5955     5956       +1     
+ Misses       1974     1973       -1     
Impacted Files Coverage Δ
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) ⬆️

@cameron-robey cameron-robey merged commit 58a430f into main Sep 28, 2022
@cameron-robey cameron-robey deleted the javascript-example-env-ctx branch September 28, 2022 11:26
@github-actions github-actions bot mentioned this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 Feature Request: include env and ctx in js example worker
2 participants