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(VanillaExtract): Use custom identifier generation #1299

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

pladaria
Copy link
Member

@pladaria pladaria commented Nov 29, 2024

Prefix Vanilla Extract identifier names with Mistica version to avoid name collision in a module federation context

Copy link

Size stats

master this branch diff
Total JS 12.2 MB 12.3 MB +22.4 kB
JS without icons 2.02 MB 2.05 MB +22.4 kB
Lib overhead 69 kB 74.1 kB +5.17 kB
Lib overhead (gzip) 16.9 kB 17.1 kB +246 B

Copy link

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

Copy link

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-h6xfmb0rm-flows-projects-65bb050e.vercel.app

Built with commit dbd799d.
This pull request is being automatically deployed with vercel-action

@pladaria pladaria marked this pull request as ready for review December 2, 2024 09:41
@pladaria pladaria changed the title WEB-2115 use custom identifier generation feat(VanillaExtract): Use custom identifier generation Dec 2, 2024

export default defineConfig({
plugins: [
react(),
vanillaExtractPlugin(),
vanillaExtractPlugin({
identifiers: ({hash}) => `${version}_${hash}`,
Copy link
Member Author

@pladaria pladaria Dec 2, 2024

Choose a reason for hiding this comment

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

another idea, to create shorter identifier names:

Create a map hash=>autoincrementCounter

and the resulting identifiers would be: v{version}_i{counter}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if that approach would work. If vite uses multiple processes to compile files, you'd have collisions

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, leaving this as is


export default defineConfig({
plugins: [
react(),
vanillaExtractPlugin(),
vanillaExtractPlugin({
identifiers: ({hash}) => `${version}_${hash}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if that approach would work. If vite uses multiple processes to compile files, you'd have collisions

@pladaria pladaria added this pull request to the merge queue Dec 4, 2024
Merged via the queue into master with commit 8872f87 Dec 4, 2024
11 checks passed
@pladaria pladaria deleted the pladaria/WEB-2115_custom-identifier branch December 4, 2024 11:02
tuentisre pushed a commit that referenced this pull request Dec 4, 2024
# [16.7.0](v16.6.1...v16.7.0) (2024-12-04)

### Features

* **StackingGroup:** use Avatar's text style for moreItems text ([#1297](#1297)) ([e45e47c](e45e47c))
* **VanillaExtract:** Use custom identifier generation ([#1299](#1299)) ([8872f87](8872f87))
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 16.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants