-
Notifications
You must be signed in to change notification settings - Fork 787
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
feat: graduate --x-include-runtime
#8166
base: next
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d4cf716 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
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/13456722174/npm-package-wrangler-8166 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8166/npm-package-wrangler-8166 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-wrangler-8166 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-workers-bindings-extension-8166 -O ./cloudflare-workers-bindings-extension.0.0.0-v9ea6f3c76.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v9ea6f3c76.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-create-cloudflare-8166 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-kv-asset-handler-8166 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-miniflare-8166 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-pages-shared-8166 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-unenv-preset-8166 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-vite-plugin-8166 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-vitest-pool-workers-8166 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-workers-editor-shared-8166 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-workers-shared-8166 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13456722174/npm-package-cloudflare-workflows-shared-8166 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
56b09dc
to
3d88fea
Compare
3d88fea
to
68d6130
Compare
c86cbf3
to
88426fa
Compare
@@ -0,0 +1,9 @@ | |||
--- | |||
"wrangler": minor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
major? pretty sure there's nothing breaking. inclusion in v4 is mostly for politeness as there's a fair amount of CI usage
a7df791
to
c931fe0
Compare
9a873ab
to
4872cb9
Compare
@@ -28,7 +28,7 @@ describe("`wrangler types` - file comment", () => { | |||
"packages", | |||
"wrangler" | |||
); | |||
execSync(`npx ${wranglerPath} types ${args}`, { | |||
execSync(`npx ${wranglerPath} types ${args} --include-runtime=false`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the describe l8 be updated? or should we not pass --include-runtime=false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm thinking about it now, this entire fixture seems a bit redundant to me, i've subsumed the relevant bits into the types e2e and deleted it.
try { | ||
const { envHeader } = await generateEnvTypes( | ||
config, | ||
{ strictVars: previousStrictVars === "false" ? false : true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ strictVars: previousStrictVars === "false" ? false : true }, | |
{ strictVars: previousStrictVars !== "false" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the current one as its easier to understand (at least for me)
packages/wrangler/src/type-generation/runtime/log-runtime-types-message.ts
Outdated
Show resolved
Hide resolved
4872cb9
to
2ef9aa4
Compare
There's one thing I was thinking about: should we also update the C3 templates? Currently the Ideally the types should not be in a static file but generated, I have a pending PR that does that for Next. I think whatever If we decide to use the runtime types, /cc @petebacondarwin |
I'm actually working on a PR right now to do that :) It'll update C3 to run |
TODO: rebase on /vnext for inclusion in wrangler v4
Might be best to review commit by commit
This PR will turn on runtime type generation by default for
wrangler types
.The
--experimental-include-runtime
flag will be superseded byinclude-runtime
andinclude-env
, both of which aretrue
by default.Also, the runtime types will be generated in the same file as the env types, at the location specified by path (
worker-configuration.d.ts
by default).Before:

After:
