style: extract global style to ensure build reproducibility #1666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We have build reproducibility with last releases.
CI: hash a2c0186 for https://github.com/dfinity/nns-dapp/actions/runs/3764587278
Local: hash 187a34a440503da62c161e679baa02b431455c17c2b6e51bc433d63dbcae2d8f
Root cause of the issue is the build of the NNS-dapp frontend that generates different entries ("keys") in the ouputed
vite-manifest.json
.Solution / Workaround
The real solution still needs to be found but to fix the reproducibitility of current state we can avoid the use of CSS mixin in favor of a global style.
If a global CSS style is used => a unique CSS is generated
If mixins are used => Svelte or Vite tries to optimize the CSS and generate a single outputed CSS for the common code. In this process it generates a file and the algorithm uses the name of the first match. Therefore we ended up with a
vite-manifest.json
containing sometimesSignInCanisters.css
orSignInNeurons.css
Changes
Screenshots