Conversation
🦋 Changeset detectedLatest commit: 6ee341c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
@petebacondarwin The latest CI run is green except for |
dario-piotrowicz
left a comment
There was a problem hiding this comment.
Thanks for the f ix @xgame92 🙂
This PR generally looks ok to me, but I left a couple of small questions
|
|
||
| const hash = createHash("sha256") | ||
| .update(consoleOutput) | ||
| .update(fileContent) |
There was a problem hiding this comment.
mh... this change seems unrelated to this PR 🤔
why are you changing the variable used here?
There was a problem hiding this comment.
This change is related to the service-worker part of the PR. generatePerEnvTypeStrings() now deliberately returns different console and file representations: the console keeps the existing export {}; declare global preview, while the written declaration must remain a script so wildcard ambient modules are valid. The header hash is what wrangler types --check compares for staleness, so it needs to hash the actual fileContent returned as envTypes; hashing consoleOutput would miss changes in effective/default declarations. The same change is applied in the single-environment path, and includes effective module rules in the generated types hash covers it.
| }), | ||
| ]; | ||
| const uniqueRuleSets = [ | ||
| ...new Map( |
There was a problem hiding this comment.
The Map is intentional here. A Set<ModuleTypeRuleSet> would compare object identity, so separately created top-level/named-environment objects with identical contents would not be deduplicated. JSON.stringify(ruleSet) provides the structural key, while the map value preserves the original typed object and first-seen order; using a Set<string> would require parsing or casting the values back.
Fixes #8893
Summary
wrangler types now includes the built-in Text, Data, and CompiledWasm module declarations in generated declaration files, using the same effective rule resolution and fallthrough semantics as deployment.
Configured rules remain the only module declarations shown in console output. Effective rules are deduplicated after glob normalization, generated-file hashes include the effective declarations, and silent API/check paths do not emit rule warnings.
Note
This is a contribution from an AI agent: OpenAI Codex.