Skip to content

Inject component code in a module to facilitate modifications #451

@Zurga

Description

@Zurga

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions