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

Enable polling support for tailwindcss cli #168

Closed
wants to merge 3 commits into from

Conversation

thebub
Copy link

@thebub thebub commented Apr 25, 2022

Reasoning

Due to an WSL2 issue (microsoft/WSL#4739) the watch mechanism of the tailwindcss cli will not work on all potential developer setups. Especially when using vscode-devcontainers and keeping the code in the mounted directory. (assumed default behavior)
The recommended work around is to use polling instead of the normal inotify based watch mechanism.

Changes

  • This pull request will add a new task to tailwindcss-rails to use the polling option instead of the watch option
  • A parameter is added to the ./bin/dev script, to switch between watch and poll mechanism
  • Default behavior of tailwindcss-rails remains unchanged

thebub and others added 2 commits April 25, 2022 19:37
* Add new task to invoke tailwindcss with the polling (-p) cli option
* Added optional parameter "p" to enable polling
* Default behavior will remain unchanged
* Changed the opsstring definition
@thebub
Copy link
Author

thebub commented May 2, 2022

Waiting for TailwindCSS to ship the polling feature. The feature was omitted in the recent v3.0.24 release.

@daveomcd
Copy link

daveomcd commented May 8, 2022

@thebub I have a new rails 7 application with tailwindcss installed. None of my CSS changes are reflected when reloading my pages. Is this a current limitation to working with WSL2? Or perhaps these issues are separate. Thanks.

@hyphenized
Copy link

@daveomcd I believe this is related to the wsl2 problem mentioned before, try moving your project files to your linux home folder (e.g. /home/daveomcd or ~) and see if the problem still happens

@thebub
Copy link
Author

thebub commented May 9, 2022

@daveomcd I suggest you follow the recommendation by @hyphenized and provide feedback, whether the problem is resolved or not.

@daveomcd
Copy link

@daveomcd I suggest you follow the recommendation by @hyphenized and provide feedback, whether the problem is resolved or not.

Hey @thebub, thank you for the response. I figured out the issue I was seeing wasn't a problem with WSL2. It was because I ran rake assets:precompile by accident. To correct the problem I had I just needed to delete all the files in my public/assets folder.

flavorjones added a commit that referenced this pull request Sep 3, 2022
Polling was added upstream in 3.1.0.

Suggested by #168
flavorjones added a commit that referenced this pull request Sep 3, 2022
Polling was added upstream in 3.1.0.

Suggested by #168
@flavorjones
Copy link
Member

I've created #199 which uses a task argument to implement this, which is a bit more flexible than a separate task (and can be combined with other options like debug from #198).

@flavorjones flavorjones closed this Sep 3, 2022
@flavorjones
Copy link
Member

v2.0.13 has this feature, please see the README for an explanation.

@thebub
Copy link
Author

thebub commented Sep 5, 2022

Thanks @flavorjones. I wasn't aware of the possibility to add options as well. This is a way better solution!

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.

None yet

4 participants