Remove support for TAILWIND_MODE=watch
#6858
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will remove the
TAILWIND_MODE=watch
functionality.What is
TAILWIND_MODE=watch
, and why is it removed?The
TAILWIND_MODE=watch
always has been a temporary solution. The issue was that we required a way to know when one of your (content) files changed to trigger a new Tailwind CSS build.PostCSS didn't have support for this, which meant that we didn't know about changes in your content files and therefore you didn't see your changes being reflected when visiting your website / web app.
The solution to this problem was introducing "directory dependency messages" in PostCSS. This allows us to register your content files as dependencies so now whenever you make a change, Tailwind would be re-triggered and now you see proper changes in your browser, yay!
See:
dir-dependency
documentation postcss/postcss#1580The issue with this is that we need to wait for all the tools to update to the latest PostCSS and this process takes a while. We also don't have control over when other tools will do this.
So we introduced
TAILWIND_MODE=watch
as a temporary solution. This created our own watcher behind the scenes to know when your content files changed.We also had this section in our docs: https://v2.tailwindcss.com/docs/just-in-time-mode#styles-don-t-update-when-saving-content-files
Some time has passed, so it is time to remove this temporary solution. The main reason for this is that we had an issue opened recently that actually caused problems with our temporary solution. You can read more about it here: #6343
The change introduced in PostCSS has been propagated to a bunch of tools already, but there is a chance that you might have issues if you use tools where this change has not yet been propagated.
What does this mean for me?
TAILWIND_MODE=watch
option, then you don't have to worry about this change at all.TAILWIND_MODE=watch
:I still have issues!
TL;DR:
TAILWIND_MODE=watch
, you are good to go!TAILWIND_MODE=watch
and it might just work