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: added option dataAttributeSalt to saltify data-attributes #435

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

khodakova
Copy link

Description

If you are dealing with MFE and own ui-kit, you need the ability to use different version of ui-kit on different MFE's.
But on our project we encountered a problem: styles from diffrent version of ui-kit overwrite each other.

Additional context

We tried to use attribute scoped on styles, but it didn't help. This is because data-attributes are based on a hash of the component code and if the styles are in a separate file the hash doesn't change.

The dataAttributeSalt option helps to provide a "salt" to a data-attribute which can contain any value you want (for example random value or version number).

Therefore styles become unique throught the MFE even if they use different versions of ui-kit with different styles.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@edison1105
Copy link
Member

It doesn't sound like an issue that needs to be solved by plugin-vue. Personally, I think the styles for multiple versions of the component library should be isolated by version, rather than relying on external tools to provide a solution. You should add a version-specific prefix to the styles when packaging ui-kit.

@edison1105 edison1105 added wontfix This will not be worked on and removed wontfix This will not be worked on labels Sep 18, 2024
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.

2 participants