@jk2908/solas 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/adapters/cloudflare/vite.js +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- The Cloudflare adapter no longer copies precompressed `.br`/`.gz` assets into the Worker's asset output. The assets binding served the Worker the compressed body, which Cloudflare then compressed again at the edge, so a hard load of a prerendered route rendered as garbled binary (a double-encoded or header-mismatched response). The Worker now serves the uncompressed asset and the edge handles encoding.
|
|
8
|
+
|
|
3
9
|
## 0.8.0
|
|
4
10
|
|
|
5
11
|
### Features
|
|
@@ -54,17 +54,25 @@ async function copyOutput(cwd) {
|
|
|
54
54
|
const artifactSource = path.join(outDir, Config.GENERATED_DIR);
|
|
55
55
|
const staticSource = path.join(outDir, 'static');
|
|
56
56
|
const assetDirs = await findAssetDirs(path.join(cwd, '.cloudflare', 'output'));
|
|
57
|
+
// Cloudflare compresses at the edge, so the Worker must serve uncompressed
|
|
58
|
+
// bytes. If a `.br`/`.gz` sibling is present the assets binding hands the
|
|
59
|
+
// Worker the precompressed body, which the edge then compresses *again*,
|
|
60
|
+
// producing a double-encoded body (or one that does not match its
|
|
61
|
+
// `content-encoding`). Skip the siblings so the Worker serves the original.
|
|
62
|
+
const skipPrecompressed = (source) => !/\.(br|gz)$/.test(source);
|
|
57
63
|
for (const assetDir of assetDirs) {
|
|
58
64
|
if (await pathExists(artifactSource)) {
|
|
59
65
|
await fs.cp(artifactSource, path.join(assetDir, NAMESPACE_PREFIX.artifact), {
|
|
60
66
|
recursive: true,
|
|
61
67
|
force: true,
|
|
68
|
+
filter: skipPrecompressed,
|
|
62
69
|
});
|
|
63
70
|
}
|
|
64
71
|
if (await pathExists(staticSource)) {
|
|
65
72
|
await fs.cp(staticSource, path.join(assetDir, NAMESPACE_PREFIX.static), {
|
|
66
73
|
recursive: true,
|
|
67
74
|
force: true,
|
|
75
|
+
filter: skipPrecompressed,
|
|
68
76
|
});
|
|
69
77
|
}
|
|
70
78
|
}
|
package/package.json
CHANGED