Coder Social home page Coder Social logo

Addons: They need a Design time interface so they can support getting involved in the generation of the Content Types. about ponzu HOT 3 CLOSED

ponzu-cms avatar ponzu-cms commented on April 28, 2024
Addons: They need a Design time interface so they can support getting involved in the generation of the Content Types.

from ponzu.

Comments (3)

nilslice avatar nilslice commented on April 28, 2024

Hi @joeblew99 -

I definitely see the use-case, and think it is an interesting idea. I'd love to see a very basic example of what you think the code would look like within an Addon, and where it would need to be accessed from the content generator.

With the Reference addon in mind, the generate-aware aspect would need to make some decisions about how to tie the two content types together. For example, would the GenerateTime interface have the ability to set the tmplString param in a reference.Select? I'm not sure how we'd define the process used to make that decision.

If it doesn't make those decisions, would it just output code that is meant to be deleted and replaced?

There have been some other points brought up about code gen in Ponzu, and we have added one to the roadmap, which you can see here: https://github.com/ponzu-cms/ponzu/projects/2#card-1540549

Maybe there is a way to integrate your idea into that feature?

from ponzu.

joeblew99 avatar joeblew99 commented on April 28, 2024

@nilslice

Thanks for adding the card. i think that sums it up well.
i dont really want to add more to that card for fear of scope creep. Just being able to do that is a good stepping stone and useful to me and others i think already.

Regarding the problem of the "Reference Select" at runtime. I am not sure myself and this is a common problem with code generators. First we would need to establish that its up to the developer to override that function. In golang we can use embedding (https://golang.org/doc/effective_go.html#embedding). The developer then just has to reference a new type that does the "Reference Select". I feel confident that this woudl also set things up for extensibility. Also this embedding approach is what goa uses, which makes me more confident it would work. We could use a IOC pattern (aka dependency injection) but i feel thats a bad pattern because it leads to compile time checking not being robust and more complexity for the developer cognitively.

Regarding your request for example code. I think its more useful to talk about how it could work because there are many options.
Basically, you need to knwo what types in already present, so that you can reference them.
At Design time, nothing is running, so the best way i think is to use AST, and parse the types already there as code itself. I like this approach because its flexible and is a design by contract pattern.

Once that base is in it opens up many extensibility aspects. One that i see is that in the future, a developer may want to use ponzu to act as a CMS on top of larger systems. One example of this is 3 micro services with a gateway fronting them written in golang. With ponzu, you can reference types expressed in the gateway. This is super cool because its gives you the ability to use Ponzu as a content inspector and editor of bigger systems. Many projects could benefit from this.

Ponzu's core principle is that its a design time tool, not runtime like other CMS systems. My above design explanation stays close to that principle. I feel its important to point this out.

from ponzu.

olliephillips avatar olliephillips commented on April 28, 2024

Closing this issue. There has been no activity in some time. Please reopen if need to.

from ponzu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.