Add phx.gen.live.slime LiveView generator #85
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.
I've added a new mix task,
phx.gen.live.slime
that tries to follow the existing designs found in thephx.gen.live
andphx.gen.html.slime
generators as closely as possible.The generated
slimleex
files should produce nearly identical HTML to what is currently provided by the stock Phoenix LiveViewphx.gen.live
generator (style, content, etc.)I was surprised when I went to extend the stock Slime LiveView generators and found them missing. Hopefully this will help someone else as they start to build their apps with phoenix_slime.
Might be a deal breaker, but this PR requires a Phoenix version bump to ~> 1.5 because of the LiveView mix tasks included with it are used by the new
phx.gen.live.slime
generator.Any quick thoughts on what to do about the linter? I can try to remove the templated
.ex
files and fallback to those provided by Phoenix itself if I can find the time. The files are interpolated/processed before they are turned into actual .ex files, which I why I believe the linter failed. Would an exemption for these templated .ex files be appropriate?If the PR gets merged I'm happy to submit a quick PR updating the documentation/readme.
Great package, using Slime in Phoenix is awesome. Thanks for all your hard work!