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

Proposal: Allow pyro DSL outside resource #1

Open
frankdugan3 opened this issue Jan 12, 2024 · 0 comments
Open

Proposal: Allow pyro DSL outside resource #1

frankdugan3 opened this issue Jan 12, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@frankdugan3
Copy link
Owner

frankdugan3 commented Jan 12, 2024

Is your proposal related to a problem? Please describe.

It is not a great model to always require UI definition inside the resource config.

Describe the solution you'd like

It would be ideal if pyro DSL could be used both inside a resource, or separately. This would allow:

  • Better architecture through separation of concerns
  • Multiple UI's to be built for the same resource(s)
  • Higher-level features, like nav_bars, which encompass multiple resources

Express the proposal either with a change to resource syntax, or with a change to the pyro interface

For example

pyro do
  resource MyApp.Resouce
end

Additional context

A possible implementation of the first parts of this idea:

  1. Add a resource option to the root pyro DSL
  2. Store __MODULE__ as the default value
  3. Add validation to the transformer to check if the resource module is actually a resource
  4. Add calls to Code.ensure_compiled(resource) to allow for the required introspection.
  5. Refactor transformers/validators to correctly reference the configured resource module instead of the DSL directly.
@frankdugan3 frankdugan3 added enhancement New feature or request help wanted Extra attention is needed labels Jan 12, 2024
@frankdugan3 frankdugan3 changed the title Proposal: Proposal: Allow pyro DSL outside resource Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant