Skip to content

jss: make classname deterministic#30065

Merged
samouri merged 9 commits intoampproject:masterfrom
samouri:jss-cx
Sep 2, 2020
Merged

jss: make classname deterministic#30065
samouri merged 9 commits intoampproject:masterfrom
samouri:jss-cx

Conversation

@samouri
Copy link
Copy Markdown
Member

@samouri samouri commented Aug 31, 2020

summary

  • Introduces a new key for classname output: key-filehash. This means you'll get a stable key independent of order in which files are transformed, but there is a very small possibility of collisions.
  • Introduces a check to fail-fast in case there is a classname collision between files.

@google-cla google-cla bot added the cla: yes label Aug 31, 2020
@amp-owners-bot
Copy link
Copy Markdown

amp-owners-bot bot commented Aug 31, 2020

Hey @erwinmombay, @jridgewell! These files were changed:

build-system/babel-plugins/babel-plugin-transform-jss/index.js
build-system/babel-plugins/babel-plugin-transform-jss/test/fixtures/transform-assertions/should-transform-jss-var/output.mjs
build-system/babel-plugins/babel-plugin-transform-jss/test/fixtures/transform-assertions/should-transform-literal/input.js
build-system/babel-plugins/babel-plugin-transform-jss/test/fixtures/transform-assertions/should-transform-literal/output.mjs
build-system/babel-plugins/babel-plugin-transform-jss/test/index.js

@samouri samouri changed the title 🐛 jss: make classname deterministic jss: make classname deterministic Aug 31, 2020
@samouri samouri requested a review from dvoytenko August 31, 2020 21:16
@samouri samouri self-assigned this Aug 31, 2020
@samouri samouri requested a review from jridgewell August 31, 2020 21:19
@samouri samouri requested a review from dvoytenko September 2, 2020 16:43
@samouri samouri merged commit 6469a3c into ampproject:master Sep 2, 2020
@samouri samouri deleted the jss-cx branch September 2, 2020 18:54
ed-bird pushed a commit to ed-bird/amphtml that referenced this pull request Dec 10, 2020
* jss: make classname deterministic

* filehash

* typo

* test should work on windows

* Use sha256

* lint

* relativize filepath to project so hashes are independent of machine

* review fixes

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants