Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: extract global style to ensure build reproducibility #1666

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Dec 23, 2022

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 sometimes SignInCanisters.css or SignInNeurons.css

Changes

  • extract common CSS to global style

Screenshots

image

Copy link
Contributor

@mstrasinskis mstrasinskis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@dubovitskaya dubovitskaya merged commit b6305ad into main Dec 23, 2022
@dubovitskaya dubovitskaya deleted the style/global-style-for-build-reproducibility branch December 23, 2022 17:19
@peterpeterparker peterpeterparker mentioned this pull request Dec 30, 2022
1 task
peterpeterparker added a commit that referenced this pull request Jan 16, 2023
# Motivation

In #1666 we have moved scoped styles to global style to workaround the build reproducibility of SvelteKit+ViteJS [#8291](sveltejs/kit#8291).

This PR redo the changes has #1670 will solve the reproducibility issue by removing the unused vite manifest file from our build results.

# PRs

- [x] #1670

# Changes

- redo scoped style and remove related global style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants