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

feat: implement new namespace strategy #2523

Merged
merged 5 commits into from
May 30, 2022
Merged

Conversation

barak007
Copy link
Collaborator

@barak007 barak007 commented May 18, 2022

Implement new universal namespace strategy
Features:

  • custom hash function
  • custom hash length strategy
  • custom/optional package info
  • better hook interface for complex namespace generation

This strategy should support our existing node, no collision and default strategy

Should close:

Should handle:

TODO:

  • pass in the origin argument
  • check if StylableOptimizer can still work for namespaces without hash
  • replace usages of old namespace strategy (maybe only in v5)?

Notes:
This strategy should not treated as breaking change unless someone was depending on the current hash (murmur) output.
We still need to check if we don't use namespace\d+ regexp in out solutions like:

  • packages\webpack-extensions\test\e2e\metadata-loader-case.spec.ts
  • packages\webpack-plugin\test\e2e\dev-mode-warnings-project.spec.ts
  • packages\webpack-plugin\test\e2e\hooked-project.spec.ts
  • packages\webpack-plugin\test\e2e\mixins-project.spec.ts
  • packages\webpack-plugin\test\e2e\stc-watched-project.spec.ts
  • packages\webpack-plugin\test\e2e\watched-project.spec.ts
  • packages\webpack-plugin\test\e2e\projects\hooked-project\stylable.config.js

packages/core/src/index.ts Outdated Show resolved Hide resolved
@barak007 barak007 requested a review from idoros May 24, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants