Skip to content

Commit

Permalink
fix: align publishing sites asset keys with Wrangler 1
Browse files Browse the repository at this point in the history
- Use the same hashing strategy for asset keys (xxhash64)
- Include the full path (from cwd) in the asset key
- Match include and exclude patterns against full path (from cwd)
- Validate that the asset key is not over 512 bytes long
  • Loading branch information
petebacondarwin committed Jan 24, 2022
1 parent 522d1a6 commit 6cc9dde
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 107 deletions.
10 changes: 10 additions & 0 deletions .changeset/quiet-steaks-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"wrangler": patch
---

fix: align publishing sites asset keys with Wrangler 1

- Use the same hashing strategy for asset keys (xxhash64)
- Include the full path (from cwd) in the asset key
- Match include and exclude patterns against full path (from cwd)
- Validate that the asset key is not over 512 bytes long
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"weakmap",
"weakset",
"webassemblymemory",
"websockets"
"websockets",
"xxhash"
],
"cSpell.ignoreWords": ["yxxx"]
}
22 changes: 19 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"esbuild": "0.14.1",
"miniflare": "2.2.0",
"path-to-regexp": "^6.2.0",
"semiver": "^1.1.0"
"semiver": "^1.1.0",
"xxhash-addon": "^1.4.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
Expand Down
8 changes: 7 additions & 1 deletion packages/wrangler/scripts/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ async function run() {
platform: "node",
format: "cjs",
// minify: true, // TODO: enable this again
external: ["fsevents", "esbuild", "miniflare", "@miniflare/core"], // todo - bundle miniflare too
external: [
"fsevents",
"esbuild",
"miniflare",
"@miniflare/core",
"xxhash-addon",
], // todo - bundle miniflare too
sourcemap: true,
inject: [path.join(__dirname, "../import_meta_url.js")],
define: {
Expand Down

0 comments on commit 6cc9dde

Please sign in to comment.