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 Phoenix LiveView support option in Torch #149

Open
cpjolicoeur opened this issue Apr 17, 2020 · 6 comments
Open

Enable Phoenix LiveView support option in Torch #149

cpjolicoeur opened this issue Apr 17, 2020 · 6 comments
Milestone

Comments

@cpjolicoeur
Copy link
Member

No description provided.

@cpjolicoeur cpjolicoeur added this to the v4.0.0 milestone Apr 17, 2020
@JoeWoodward
Copy link

It's really not easy to use Torch with liveview. The classes are an issue. The PageView includes body_classes/2 which fails with a live page. I've been bypassing these classes by checking if the conn include the action name. However, now I have an issue that the css is tied to the body

e.g. the .torch-new, .torch-index classes etc are all defined as body.torch-new, body.torch-index etc. This means I can't use those classes easily. I was planning on just wrapping my live templates in the correct classes but that's not possible.

form#torch-form is also incompatible as live forms don't actually use an html form element. I bypassed this by importing the styles into my app without attaching them to the form e.g. instead of form#torch-form I imported as #torch-form.

Would be really good to improve this when live view support is implemented.

@cpjolicoeur
Copy link
Member Author

@JoeWoodward Thanks for the info/notes here. We haven't gotten too far down the line with making a LiveView "version" of Torch yet, but we'll keep these notes in mind as we progress on it.

@nickurban
Copy link

Looks like @andreaseriksson has started on this: https://github.com/fullstack-phoenix/lit

@andreaseriksson
Copy link

@cpjolicoeur do you have any idea how the install generator should work?

mix torch.install

I mean, mean, should it detect if liveview is installed and to a leex-version of the layout template or should that be an option passed in?

@cpjolicoeur
Copy link
Member Author

@andreaseriksson I'd prefer to see a --live flag to force live view regardless. We'd want/need a manual flag at a minimum.

mix torch.install --live

It would be nice though to auto-detect, if possible, if the phoenix app was/is using liveview and then default to liveview templates in that case, (or perhaps prompt the user).

@andreaseriksson
Copy link

@cpjolicoeur got it.

@cpjolicoeur cpjolicoeur modified the milestones: v4.0.0, v5.0.0, v6.0.0 May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants