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

Feature Request: avoid hash clashes #208

Closed
chrisbateman opened this issue Jul 3, 2018 · 3 comments
Closed

Feature Request: avoid hash clashes #208

chrisbateman opened this issue Jul 3, 2018 · 3 comments

Comments

@chrisbateman
Copy link

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Hashes are generated from the filename, which can lead to clashes in the following cases:

  • 2 different versions of the same library where the styles changed between versions (this is my primary use case)
  • 2 separate libraries that both use Linaria and have the same variable names in files with the same name (e.g. styles.js).

What is the expected behavior?
Possible solutions:

  • Always generate hashes based on the styles (I did see the discussion in Issues with class name generation #147 so I'm not sure how feasible you think this)
    • FWIW I believe this is what Emotion does
  • Provide an option in linaria/babel to customize the classname generation, which puts responsibility on the user to ensure uniqueness

p.s. Sorry to keep opening issues – I think this is the last one! Would be happy to help contribute if I can.

@satya164
Copy link
Member

satya164 commented Jul 4, 2018

You might wanna check my RFC regarding publishing libraries to NPM: #178

@satya164
Copy link
Member

satya164 commented Jul 4, 2018

We could also default to [name]@[version]~[filename] for hashes, and allow customizing it.

@zamotany
Copy link
Contributor

I'm going to close this one in favour of #299

chrisbateman added a commit to chrisbateman/linaria that referenced this issue Mar 31, 2019
chrisbateman added a commit to chrisbateman/linaria that referenced this issue Mar 31, 2019
chrisbateman added a commit to chrisbateman/linaria that referenced this issue Mar 31, 2019
chrisbateman added a commit to chrisbateman/linaria that referenced this issue Mar 31, 2019
chrisbateman added a commit to chrisbateman/linaria that referenced this issue Apr 3, 2019
chrisbateman added a commit to chrisbateman/linaria that referenced this issue Apr 3, 2019
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

No branches or pull requests

3 participants