You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The modification options that are provided by the build_[component] macro are nice, but sometimes you want to modify the HEEX in the component itself. Or you might want to add an attr to a component.
Describe the solution you'd like
I want to run a mix task that will inject the code that is generated by a build_[component] macro to be inserted into a given file or module.
i.e. mix doggo.inject modal MyProjectWeb.CoreComponents
Describe alternatives you've considered CodeGen is a library that achieves this. It is used in action by this library: BootStrap5Components. The component code is here: components/code_gen.
Additional context
Add any other context about the feature request here.
The text was updated successfully, but these errors were encountered:
Interesting. I was considering using Igniter for the story generation. Injection of the actual components would be useful, and it might even make it possible to generate cleaner component code (I haven't found a way to unquote anything within the HEEx template). The trade-off of course is that it will make it more difficult to apply improvements to those components when a new version is released. I'll do some experimenting when I find some time.
I have seen Igniter but haven't used it much. For my project (a personal remix of Phoenix) I reuse the Phoenix generators, but wrap or replace functions in the abstract code of the Phoenix generator and then recompile that module to a namespaced one.
As for the tradeoff, if you simply re-run the injection task after upgrading Doggo, the new function is appended after the old one and then the user can decide what they want to do. I guess that if you made modifications, it would be unexpected that upgrading Doggo would automatically undo those modifications or change them.
Is your feature request related to a problem? Please describe.
The modification options that are provided by the
build_[component]
macro are nice, but sometimes you want to modify the HEEX in the component itself. Or you might want to add anattr
to a component.Describe the solution you'd like
I want to run a mix task that will inject the code that is generated by a
build_[component]
macro to be inserted into a given file or module.i.e.
mix doggo.inject modal MyProjectWeb.CoreComponents
Describe alternatives you've considered
CodeGen is a library that achieves this. It is used in action by this library: BootStrap5Components. The component code is here: components/code_gen.
Additional context
Add any other context about the feature request here.
The text was updated successfully, but these errors were encountered: