diff --git a/patches/glimmer-scoped-css@0.8.1.patch b/patches/glimmer-scoped-css@0.8.1.patch new file mode 100644 index 00000000000..230e5bda8f5 --- /dev/null +++ b/patches/glimmer-scoped-css@0.8.1.patch @@ -0,0 +1,47 @@ +diff --git a/dist/ast-transform-8c8ef165.js b/dist/ast-transform-8c8ef165.js +index 066d5bc5f9e350d855d7d48ae56f47b4e33907bc..3483e529a009cbe4b6019ada0c332411b660595a 100644 +--- a/dist/ast-transform-8c8ef165.js ++++ b/dist/ast-transform-8c8ef165.js +@@ -164,8 +164,41 @@ function decodeCSS(encodedCSSString) { + return new TextDecoder().decode(Uint8Array.from(binString, m => m.codePointAt(0))); + } + ++// The scope prefix must be the same for the same source on every machine: ++// prerendered HTML carries the prefixes of the build that rendered it, and a ++// build at another path must still style it. A file on disk is identified by ++// its path relative to the working directory of the build. Anything else keeps ++// its filename, including the synthetic paths a realm transpiles under ++// (`/spec.gts`), which do not exist on disk and are already stable. Both ++// paths are resolved through symlinks first: `process.cwd()` is always ++// resolved, and a filename reached through a symlink would otherwise give a ++// path up to the root and back down, which holds the absolute path again. ++function cwdRelativeId(filename) { ++ let fs; ++ try { ++ fs = require('fs'); ++ } catch { ++ return undefined; ++ } ++ if ( ++ !fs || ++ typeof fs.existsSync !== 'function' || ++ typeof fs.realpathSync !== 'function' || ++ typeof process === 'undefined' || ++ typeof process.cwd !== 'function' || ++ typeof filename !== 'string' || ++ !path.isAbsolute(filename) || ++ !fs.existsSync(filename) ++ ) { ++ return undefined; ++ } ++ return path ++ .relative(fs.realpathSync(process.cwd()), fs.realpathSync(filename)) ++ .split(path.sep) ++ .join('/'); ++} + function uniqueIdentifier(filename) { +- return superFastMd5.md5(filename).slice(0, 10); ++ return superFastMd5.md5(cwdRelativeId(filename) ?? filename).slice(0, 10); + } + function generateScopedCSSPlugin(options) { + return env => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bcf5425b790..ba895997329 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -742,6 +742,7 @@ patchedDependencies: ember-css-url@1.0.0: 0e5253a008cc7bf02424d786e7a8fb2397bc48962f3cd1443f2c0fdd8200c96d ember-eslint-parser: 364c7e71472801c87618bf2b2cdabd256358166bbe107f29d321ab35d0a53425 ember-source: ea945024993105fb6cc4ae5cb5e9ea8e0eff6cd5fe0b0033c43dd0cf9453eb0d + glimmer-scoped-css@0.8.1: 986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b magic-string@0.25.9: 32dda55b40f0bc860d0a8e93bee54d8005c34ed7ac5faed23ce9f5e5f57eea39 matrix-js-sdk@38.3.0: 9916a9e914367042bf4e45522e7ccc4cfafb8893276852608baa57080b654f89 monaco-editor@0.52.2: bdefe071221b87c7c15e1add6739d24d486f543dbad0d714ae586085204626cd @@ -1701,7 +1702,7 @@ importers: version: 3.3.0(@typescript-eslint/parser@8.67.0(eslint@9.39.5(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.9.3))(eslint@9.39.5(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.9.3) glimmer-scoped-css: specifier: 'catalog:' - version: 0.8.1(supports-color@8.1.1) + version: 0.8.1(patch_hash=986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b)(supports-color@8.1.1) globals: specifier: ^15.14.0 version: 15.15.0 @@ -1942,7 +1943,7 @@ importers: version: 8.2.6(eslint@8.57.1(supports-color@8.1.1)) glimmer-scoped-css: specifier: 'catalog:' - version: 0.8.1(supports-color@8.1.1) + version: 0.8.1(patch_hash=986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b)(supports-color@8.1.1) prettier: specifier: 'catalog:' version: 3.8.4 @@ -3260,7 +3261,7 @@ importers: version: link:../glimmer-motion glimmer-scoped-css: specifier: 'catalog:' - version: 0.8.1(supports-color@8.1.1) + version: 0.8.1(patch_hash=986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b)(supports-color@8.1.1) ignore: specifier: 'catalog:' version: 5.3.2 @@ -3763,7 +3764,7 @@ importers: version: 11.3.5 glimmer-scoped-css: specifier: 'catalog:' - version: 0.8.1(supports-color@8.1.1) + version: 0.8.1(patch_hash=986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b)(supports-color@8.1.1) glob: specifier: 'catalog:' version: 11.1.0 @@ -4048,7 +4049,7 @@ importers: version: 5.0.2 glimmer-scoped-css: specifier: 'catalog:' - version: 0.8.1(supports-color@8.1.1) + version: 0.8.1(patch_hash=986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b)(supports-color@8.1.1) http-status-codes: specifier: 'catalog:' version: 2.3.0 @@ -27170,7 +27171,7 @@ snapshots: github-slugger@2.0.0: {} - glimmer-scoped-css@0.8.1(supports-color@8.1.1): + glimmer-scoped-css@0.8.1(patch_hash=986cd65c9ffc8b062a227f0d09dd76f021b1654c7d90185548f5647e9eca632b)(supports-color@8.1.1): dependencies: '@embroider/addon-shim': 1.10.3(supports-color@8.1.1) js-string-escape: 1.0.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1fc996e4c47..e5952498942 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -329,6 +329,7 @@ patchedDependencies: matrix-js-sdk@38.3.0: patches/matrix-js-sdk@38.3.0.patch ember-source: patches/ember-source.patch object-inspect: patches/object-inspect.patch + glimmer-scoped-css@0.8.1: patches/glimmer-scoped-css@0.8.1.patch allowBuilds: "@percy/core": true "@vscode/vsce-sign": true