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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
wrangler@0.0.20
Patch Changes
#627
ff53f4e
Thanks @petebacondarwin! - fix: do not warn about miniflare in the configuration#649
e0b9366
Thanks @threepointone! - fix: useexpiration_ttl
to expire assets with[site]
This switches how we expire static assets with
[site]
uploads to useexpiration_ttl
instead ofexpiration
. This is because we can't trust the time that a deploy target may provide (like in Expiration changes hanging deploys wrangler-legacy#2224).#599
7d4ea43
Thanks @caass! - Force-open a chromium-based browser for devtoolsWe rely on Chromium-based devtools for debugging workers, so when opening up the devtools URL,
we should force a chromium-based browser to launch. For now, this means checking (in order)
for Chrome and Edge, and then failing if neither of those are available.
#567
05b81c5
Thanks @threepointone! - fix: consolidategetEntry()
logicThis consolidates some logic into
getEntry()
, namely includingguessWorkerFormat()
and custom builds. This simplifies the code for bothdev
andpublish
.dev
assumed it could be a long running process; however it's not (else consider thatpublish
would never work).getEntry()
, we can be certain that the entry point exists as we validate it and before we enterdev
/publish
, simplifying their internalswrangler dev
because it's now a one shot build (and always should have been)dev
andpublish
.getEntry()
<Dev/>
, which is always a good thing#628
b640ab5
Thanks @caass! - Validate that ifroute
exists in wrangler.toml,routes
does not (and vice versa)#591
42c2c0f
Thanks @petebacondarwin! - fix: add warning about setting upstream-protocol tohttp
We have not implemented setting upstream-protocol to
http
and currently do not intend to.This change just adds a warning if a developer tries to do so and provides a link to an issue where they can add their use-case.
#596
187264d
Thanks @threepointone! - feat: support wrangler 1.x module specifiers with a deprecation warningThis implements wrangler 1.x style module specifiers, but also logs a deprecation warning for every usage.
Consider a project like so:
where the content of
index.js
is:wrangler
1.x would resolveimport SomeDependency from "some-dependency.js";
to the filesome-dependency.js
. This will work inwrangler
v2, but it will log a deprecation warning. Instead, you should rewrite the import to specify that it's a relative path, like so:In a near future version, this will become a breaking deprecation and throw an error.
(This also updates
workers-chat-demo
to use the older style specifier, since that's how it currently is at https://github.com/cloudflare/workers-chat-demo)Known issue: This might not work as expected with
.js
/.cjs
/.mjs
files as expected, but that's something to be fixed overall with the module system.Closes support/deprecate wrangler1 style module specifiers #586
#579
2f0e59b
Thanks @JacobMGEvans! - feat: Incomplete subcommands render a help message for that specific subcommand.#559
16fb5e6
Thanks @petebacondarwin! - feat: support adding secrets in non-interactive modeNow the user can pipe in the secret value to the
wrangler secret put
command.For example:
This requires that the user is logged in, and has only one account, or that the
account_id
has been set inwrangler.toml
.Fixes Trying to configure secret yield an "Raw mode not supported" from vadimdemdes/ink package #170
#597
94c2698
Thanks @caass! - Deprecatewrangler route
,wrangler route list
, andwrangler route delete
Users should instead modify their wrangler.toml or use the
--routes
flag when publishingto manage routes.
#564
ffd5c0d
Thanks @GregBrimble! - Request Pages OAuth scopes when logging in#638
06f9278
Thanks @threepointone! - polish: add a small banner for commandsThis adds a small banner for most commands. Specifically, we avoid any commands that maybe used as a parse input (like json into jq). The banner itself simply says "⛅️ wrangler" with an orange underline.
#561
6e9a219
Thanks @threepointone! - fix: resolve modules correctly inwrangler dev --local
This is an alternate fix to generate "real" paths for identifiers when linking modules. miniflare#205, and fixes the error where miniflare would get confused resolving relative modules on macs because of
/var
//private/var
being symlinks. Instead, werealpathSync
the bundle path before passing it on to miniflare, and that appears to fix the problem.Test plan:
Fixes fix: import wasm module from a higher directory fails in
wrangler dev --local
for a module format worker #443#592
56886cf
Thanks @caass! - Stop reporting breadcrumbs to sentrySentry's SDK automatically tracks "breadcrumbs", which are pieces of information
that get tracked leading up to an exception. This can be useful for debugging
errors because it gives better insight into what happens before an error occurs,
so you can more easily understand and recreate exactly what happened before an
error occurred.
Unfortunately, Sentry automatically includes all
console
statements. And sincewe use the console a lot (e.g. logging every request received in
wrangler dev
),this is mostly useless. Additionally, since developers frequently use the console
to debug their workers we end up with a bunch of data that is not only irrelevant
to the reported error, but also contains data that could be potentially sensitive.
For now, we're turning off breadcrumbs entirely. Later, we might wish to add our
own breadcrumbs manually (e.g. add a "wrangler dev" breadcrumb when a user runs
wrangler dev
), at which point we can selectively enable breadcrumbs to catchonly the ones we've put in there ourselves.
#645
61aea30
Thanks @petebacondarwin! - fix: improve authentication logging and warningsFixes #526
#608
a7fa544
Thanks @sidharthachatterjee! - fix: Ensure generateConfigFromFileTree generates config correctly for multiple splatsFunctions with multiple parameters, like /near/[latitude]/[longitude].ts wouldn't work. This
fixes that.
#580
8013e0a
Thanks @petebacondarwin! - feat: add support for--local-protocol=https
towrangler dev
This change adds full support for the setting the protocol that the localhost proxy server listens to.
Previously, it was only possible to use
HTTP
. But now you can set it toHTTPS
as well.To support
HTTPS
, Wrangler needs an SSL certificate.Wrangler now generates a self-signed certificate, as needed, and caches it in the
~/.wrangler/local-cert
directory.These certificates expire after 30 days and are regenerated by Wrangler as needed.
Note that if you use HTTPS then your browser will complain about the self-signed and you must tell it to accept the certificate before it will let you access the page.
#639
5161e1e
Thanks @petebacondarwin! - refactor: initialize the user auth state synchronouslyWe can now initialize the user state synchronously, which means that
we can remove the checks for whether it has been done or not in each
of the user auth functions.
#580
aaac8dd
Thanks @petebacondarwin! - fix: validate that local_protocol and upstream_protocol can only take "http" or "https"#568
b6f2266
Thanks @caass! - Show an actionable error message when publishing to a workers.dev subdomain that hasn't been created yet.When publishing a worker to workers.dev, you need to first have registered your workers.dev subdomain
(e.g. my-subdomain.workers.dev). We now check to ensure that the user has created their subdomain before
uploading a worker to workers.dev, and if they haven't, we provide a link to where they can go through
the workers onboarding flow and create one.
#641
21ee93e
Thanks @petebacondarwin! - fix: error if a non-legacy service environment tries to define a worker nameGiven that service environments all live off the same worker, it doesn't make sense
for them to have different names.
This change adds validation to tell the developer to remove such
name
fields inservice environment config.
Fixes fix:
name
shouldn't be defined in environments iflegacy_env = false
#623#646
c75cfb8
Thanks @threepointone! - fix: defaultwatch_dir
tosrc
of project directoryVia wrangler 1, when using custom builds in
wrangler dev
,watch_dir
should default tosrc
of the "project directory" (i.e - wherever thewrangler.toml
is defined if it exists, else in the cwd.Fixes 🐛 BUG: wrangler dev does not watch for source changes when using a custom build command #631
#621
e452a04
Thanks @petebacondarwin! - fix: stop checking for open port once it has timed out inwaitForPortToBeAvailable()
Previously, if
waitForPortToBeAvailable()
timed out, thecheckPort()
function would continue to be called.
Now we clean up fully once the promise is resolved or rejected.
#600
1bbd834
Thanks @skirsten! - fix: use environment specific and inherited config values inpublish
#577
7faf0eb
Thanks @threepointone! - fix:config.site.entry-point
as a breaking deprecationThis makes configuring
site.entry-point
in config as a breaking deprecation, and throws an error. We do this because existing apps withsite.entry-point
won't work in v2.#578
c56847c
Thanks @threepointone! - fix: gracefully fail if we can't create~/.wrangler/reporting.toml
In some scenarios (CI/CD, docker, etc), we won't have write access to
~/.wrangler
. We already don't write a configuration file there if one passes aCF_API_TOKEN
/CLOUDFLARE_API_TOKEN
env var. This also adds a guard when writing the error reporting configuration file.#621
e452a04
Thanks @petebacondarwin! - fix: check for the correct inspector port in local devPreviously, the
useLocalWorker()
hook was being passed the wrong port for theinspectorPort
prop.Once this was fixed, it became apparent that we were waiting for the port to become free in the wrong place, since this port is already being listened to in
useInspector()
by the time we were starting the check.Now, the check to see if the inspector port is free is done in
useInspector()
,which also means that
Remote
benefits from this check too.#587
49869a3
Thanks @threepointone! - feat: expire unused assets in[site]
uploadsThis expires any previously uploaded assets when using a Sites /
[site]
configuration. Because we currently do a full iteration of a namespace's keys when publishing, for rapidly changing sites this means that uploads get slower and slower. We can't just delete unused assets because it leads to occasional 404s on older publishes while we're publishing. So we expire previous assets while uploading new ones. The implementation/constraints of the kv api means that uploads may become slower, but should hopefully be faster overall. These optimisations also only matter for rapidly changing sites, so common usecases still have the same perf characteristics.#580
9ef36a9
Thanks @petebacondarwin! - fix: improve validation error message for fields that must be one of a selection of choicesexample-pages-functions-app@null
example-pages-functions-app
null
Patch Changes
8c98c00
Thanks @GregBrimble! - Added a Pages Functions example project for tests