Skip to content

Commit 04b3b66

Browse files
authored
Merge pull request #592 from rails/flavorjones/remove-v3-poll
Remove the "poll" option on the watch command
2 parents db7c010 + 5520c23 commit 04b3b66

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## next / unreleased
44

5+
### Changed
6+
7+
* Removed the "poll" option on the watch command, since Tailwind v4 dropped support for this option (and it has been a no-op in this gem since.) #580 @flavorjones
8+
9+
510
### Improved
611

712
* Support Rails 8.1 scaffolding which disables system tests by default. #585 @flavorjones

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Tailwind CSS for Rails
22

3-
[Tailwind CSS](https://tailwindcss.com) is a utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 that can be composed to build any design, directly in your markup.
3+
[Tailwind CSS](https://tailwindcss.com) is a utility-first CSS framework packed with classes like `flex`, `pt-4`, `text-center` and `rotate-90` that can be composed to build any design, directly in your markup.
4+
5+
> [!NOTE]
6+
> This document is specific to Tailwind v4, corresponding to v4 of this gem. If you are looking for documentation for v3, please visit to the [tailwindcss-rails v3
7+
README](https://github.com/rails/tailwindcss-rails/tree/v3-stable?tab=readme-ov-file).
48

59
<!-- regenerate TOC with `rake format:toc` -->
610

@@ -262,12 +266,13 @@ Synopsis:
262266
- `bin/rails tailwindcss:install` - installs the configuration file, output file, and `Procfile.dev`
263267
- `bin/rails tailwindcss:build` - generate the output file
264268
- `bin/rails tailwindcss:build[debug]` - generate unminimized output
269+
- `bin/rails tailwindcss:build[verbose]` - emit the commands being run
265270
- `bin/rails tailwindcss:watch` - start live rebuilds, generating output on file changes
266271
- `bin/rails tailwindcss:watch[debug]` - generate unminimized output
267-
- `bin/rails tailwindcss:watch[poll]` - for systems without file system events
268272
- `bin/rails tailwindcss:watch[always]` - for systems without TTY (e.g., some docker containers)
273+
- `bin/rails tailwindcss:watch[verbose]` - emit the commands being run
269274
270-
Note that you can combine task options, e.g. `rails tailwindcss:watch[debug,poll]`.
275+
Note that you can combine task options, e.g. `rails tailwindcss:watch[debug,always]`.
271276
272277
This gem also makes available a Puma plugin to manage a live rebuild process when you run `rails server` (see "Live Rebuild" section below).
273278
@@ -312,14 +317,6 @@ and then running `rails server` (or just `puma`) will run the Tailwind watch pro
312317
313318
This is a flexible command, which can be run with a few different options.
314319
315-
If you are running `rails tailwindcss:watch` on a system that doesn't fully support file system events, pass a `poll` argument to the task to instruct tailwindcss to instead use polling:
316-
317-
```
318-
rails tailwindcss:watch[poll]
319-
```
320-
321-
(If you use `bin/dev` then you should modify your `Procfile.dev` to use the `poll` option.)
322-
323320
If you are running `rails tailwindcss:watch` as a process in a Docker container, set `tty: true` in `docker-compose.yml` for the appropriate container to keep the watch process running.
324321
325322
If you are running `rails tailwindcss:watch` in a docker container without a tty, pass the `always` argument to the task to instruct tailwindcss to keep the watcher alive even when `stdin` is closed: `rails tailwindcss:watch[always]`. If you use `bin/dev` then you should modify your `Procfile.dev`.

lib/tailwindcss/commands.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ def compile_command(debug: false, **kwargs)
2121
command
2222
end
2323

24-
def watch_command(always: false, poll: false, **kwargs)
24+
def watch_command(always: false, **kwargs)
2525
compile_command(**kwargs).tap do |command|
2626
command << "-w"
2727
command << "always" if always
28-
command << "-p" if poll
2928
end
3029
end
3130

lib/tasks/build.rake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ namespace :tailwindcss do
1414
desc "Watch and build your Tailwind CSS on file changes"
1515
task watch: [:environment, :engines] do |_, args|
1616
debug = args.extras.include?("debug")
17-
poll = args.extras.include?("poll")
1817
always = args.extras.include?("always")
1918
verbose = args.extras.include?("verbose")
2019

21-
command = Tailwindcss::Commands.watch_command(always: always, debug: debug, poll: poll)
20+
command = Tailwindcss::Commands.watch_command(always: always, debug: debug)
2221
env = Tailwindcss::Commands.command_env(verbose: verbose)
2322
puts "Running: #{Shellwords.join(command)}" if verbose
2423

test/lib/tailwindcss/commands_test.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ def setup
111111
refute_includes(actual, "-p")
112112
refute_includes(actual, "--minify")
113113

114-
actual = Tailwindcss::Commands.watch_command(poll: true)
115-
assert_kind_of(Array, actual)
116-
assert_equal(executable, actual.first)
117-
assert_includes(actual, "-w")
118-
refute_includes(actual, "always")
119-
assert_includes(actual, "-p")
120-
assert_includes(actual, "--minify")
121-
122114
actual = Tailwindcss::Commands.watch_command(always: true)
123115
assert_kind_of(Array, actual)
124116
assert_equal(executable, actual.first)

0 commit comments

Comments
 (0)