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

fix: pass routes to dev session #1213

Merged
merged 1 commit into from
Jun 28, 2022
Merged

fix: pass routes to dev session #1213

merged 1 commit into from
Jun 28, 2022

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented Jun 9, 2022

We can pass routes when creating a dev session. The effect of this is when you visit a path that doesn't match the given routes, then it instead does a fetch from the deployed worker on that path (if any). We were previously passing */*, i.e, matching all routes in dev; this fix now passes configured routes instead. Based on #1055

@changeset-bot
Copy link

changeset-bot bot commented Jun 9, 2022

🦋 Changeset detected

Latest commit: 34b64b0

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

github-actions bot commented Jun 9, 2022

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/2576019442/npm-package-wrangler-1213

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2576019442/npm-package-wrangler-1213 dev path/to/script.js

@threepointone
Copy link
Contributor Author

This has problems when there are multiple hosts in the routes, and when different zone_name/zone_id's are provided. Need to work on this some more, moving to draft.

@threepointone threepointone marked this pull request as draft June 9, 2022 21:20
@threepointone threepointone changed the title fix: pass routes to dev session WIP - fix: pass routes to dev session Jun 10, 2022
We can pass routes when creating a `dev` session. The effect of this is when you visit a path that _doesn't_ match the given routes, then it instead does a fetch from the deployed worker on that path (if any). We were previously passing `*/*`, i.e, matching _all_ routes in dev; this fix now passes configured routes instead.
@threepointone threepointone marked this pull request as ready for review June 28, 2022 12:06
@threepointone
Copy link
Contributor Author

Ok, I've tested that this doesn't break if you pass multiple hosts in routes to dev. This looks ready for review.

@threepointone threepointone changed the title WIP - fix: pass routes to dev session fix: pass routes to dev session Jun 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.

2 participants