Support component generator for tailwindcss-rails#1098
Support component generator for tailwindcss-rails#1098Spone merged 1 commit intoViewComponent:mainfrom
Conversation
38a5afc to
4118a0c
Compare
|
Hi @dixpac! Thanks for your PR! I'm not much of a Tailwind user, can you elaborate on what's the expected behavior for the generator? I read the diff quickly and I'm not sure I understand how this differs from the regular generator? |
|
Yeah, it is pretty much the default rails generator with tailwindcss templates. Inside the engine, template name is Generator just needs to create same files as with I hope this helps :) |
|
This would certainly be useful for those of us using tailwindcss-rails. For others using view_component and tailwindcss-rails this workaround will keep you going.
|
|
@dixpac can you please rebase to resolve the conflicts, and try to fix the tests that do not pass for Rails 5? |
|
@Spone sure I will try. Rails 5 will be a bit harder since tw-rails is rails >= 6, but we will make it work somehow :) |
|
What do you think about using Appraisal? You will be able to install tailwindcss-rails only for rails 6. |
|
👋🏻 I think it's worth pursuing conditionally adding this support only in Rails >= 6, as long as we make it clear in the documentation. The Rails asset delivery story has certainly changed a bit from 5>6>7 and I think it's not unreasonable to expect folks to be reasonably up to date to use this functionality. |
081de18 to
4f674de
Compare
|
I tried this without success (works locally, but not in CI). @joelhawksley would you be open to adding Appraisal? I think it's the cleanest way to implement conditional dependencies. It would also make locally running tests for all versions of Rails much easier. |
|
@Spone I'm totally fine with adding Appraisal ❤️ |
|
@Spone Worth noting that there may be complexity getting Appraisal to fully work with Github Actions: thoughtbot/appraisal#174 (comment) |
|
@pboling I haven't looked into it in detail yet, but I know we're using Appraisal + Github Actions to test https://github.com/pantographe/view_component-form without issues. |
|
Is still useful with the new tailwindcss-rails? |
|
@coder2000 yes. If you want to "attack" adding Appraisal that would be awesome |
|
Hi @dixpac, Appraisal is now setup and I used it in your PR to manage the conditional dependency to |
|
👏🏼 @Spone thank you! I'll bump and resolve the conflict |
040fb96 to
a54e20d
Compare
This commit adds support for [`tailwindcss-rails](https://github.com/rails/tailwindcss-rails)` engine. This is my first contribution so I hope I did this correctly. I've spinend up demo app with `view_component` and `tailwindcss-rails` and it works. But, I may have missed something :) Co-authored-by: Hans Lemuet <38524+Spone@users.noreply.github.com>
a54e20d to
9dc531d
Compare
|
@Spone version bumped, conflicts fixed, squashed and I've added you as a co-author :) |
|
|
||
| gem "capybara", "~> 3" | ||
| gem "rails", "~> 6.0.0" | ||
| gem "tailwindcss-rails", "~> 2.0" |
There was a problem hiding this comment.
I think 2 as a dependency is what we are looking for, since tailwindcss-rails version 1 was not complete and it was missing some of the major tailwindcss parts. That is solved with version 2, so I can't really see anyone using version 1 :)
This commit adds support for tailwindcss-rails engine.
This is my first contribution so I hope I did this correctly.
I've spinend up demo app with
view_componentandtailwindcss-railsand it works.But, I may have missed something :)