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

Fix/icss hashing #52

Merged
merged 4 commits into from
Apr 16, 2021
Merged

Fix/icss hashing #52

merged 4 commits into from
Apr 16, 2021

Conversation

axyz
Copy link
Member

@axyz axyz commented Apr 16, 2021

@sylvesteraswin

  • prevent icss imports to pollute the package name part of the key in the hash cache
  • add example of duplicated classes in different atoms

@@ -1,5 +1,5 @@
export var localClass = "n4oS1I";
export var localComposes = "i6EUck n4oS1I dgII7d";
export var simpleComposes = "";
Copy link
Member Author

Choose a reason for hiding this comment

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

@sylvesteraswin this was definitely wrong before

export var localComposes = "i6EUck n4oS1I dgII7d";
export var simpleComposes = "";
export var complexComposes = "i6EUck n4oS1I dgII7d _1RrCqF pQ96hs";
export var extend = "_8F86eH"
Copy link
Member Author

Choose a reason for hiding this comment

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

also in these some hashes were missing from the imported ones

// short circuit: electron definition for a given name is always
// highest priority and unique source of truth.
return DEVELOPMENT ? `${name.toUpperCase()}_${hash}` : hash;
Copy link
Member Author

Choose a reason for hiding this comment

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

this return is in the nested function (wakRules) so it doesn't really need a value, but just returning will not override the key later on in this function

@@ -58,20 +57,6 @@ const generateScopedName: generateScopedName = ({
} else {
pkgName = importedPackage;
}
} else if (/:import/.test(rule.selector)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@sylvesteraswin this seem to be the culprit: what was happening basically is that classes in a file with a css import were being evaluated twice with one f the time getting the package name of the imported module (e.g. @my-org/simple-class;withSharedVar).

removing it and returning when rule is a ISS import seems to work fine with the hashes and I also ran the integration tests multiple times to check consstency

@sylvesteraswin
Copy link
Contributor

👍

1 similar comment
@axyz
Copy link
Member Author

axyz commented Apr 16, 2021

👍

@axyz axyz merged commit dcd051d into master Apr 16, 2021
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

2 participants