Skip to content

Conversation

jmerro
Copy link

@jmerro jmerro commented Dec 11, 2024

When adding tailwind classes to a template, the builder notifies Vite with a ComponentUpdate which reloads the template on the client with the new classes. However, if the global styles.css from the build output was changed due to a new class being added there. The client won't be served that new styles.css- until a Full Update or rebuild occurs. This commit is primarily a workaround until better support can be added for this scenario.

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Newly added tailwind classes won't render their styles when ComponentUpdate sent, as the styles.css is not being checked for changes.

What is the new behavior?

On ComponentUpdate vite will also check the styles.css hash and if it is different send a css-update to the client to reload the global styles with the missing tailwind classes.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

When adding tailwind classes to a template, the builder notifies vite with a ComponentUpdate which reloads the template on the client with the new classes. However, if the global styles.css from the build output was changed due to a new class being added there. The client won't be served that new styles.css- until a Full Update or rebuild occurs.
This commit is primarily a workaround until better support can be added for this scenario.
@thepuzzlemaster
Copy link

For anyone else finding their way here, closed as a result of this pr getting merged in.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants