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

mix generator has issues when dealing with nested liveview module namespace #222

Open
qq99 opened this issue Jan 2, 2025 · 2 comments
Open

Comments

@qq99
Copy link

qq99 commented Jan 2, 2025

Imagine your liveview is the module defmodule MyApp.SearchLive.Index

You run mix lvn.gen.live swiftui SearchLive.Index or mix lvn.gen.live swiftui Search, both have issues with the assumptions the generator makes

This can be made to work manually with some manual renaming of the modules, but I noticed that it wasn't able to find the default *.neex file, it complained about a missing render function. If you add a manually defined render fn to the new file, it will work however.

Perhaps one should have to supply the full namespace to the generator command (e.g., SearchLive.Index) instead of the currently desired Search

@bcardarella
Copy link
Contributor

I'll see about getting this into 0.4.0-rc.1. For 0.5.0 we'll be moving the generators to a new project that isn't yet created but will be specific for the phoenix app structure.

In this case I'm thinking that the module should be MyApp.SearchLive.SwiftUI.Index thoughts?

@qq99
Copy link
Author

qq99 commented Jan 3, 2025

So far I've been thinking in the frame of "add a .SwiftUI to the end of your module"

I'm currently expecting all the SwiftUI code to be *.swiftui.ex or *.swiftui.neex, so my current naive mental model suggests the module subspace should come at the end too

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

No branches or pull requests

2 participants