Comments (3)
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.
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.
Closing this issue. There has been no activity in some time. Please reopen if need to.
from ponzu.
Related Issues (20)
- CLI is not working HOT 14
- Zap v11 was deleted HOT 14
- go module support HOT 9
- search sort HOT 2
- Custom databases HOT 3
- ponzu 0.11.0 fails to build HOT 2
- The "must" search operator in blevesearch can't be passed into ponzu HOT 1
- NOTICE: original author & maintainer is stepping away from the project HOT 7
- how to change to Summernote
- Redis Support for ponzu
- There is three CSRF vulnerability that can add the administrator account, delete administrator account, edit configuration.
- Only latest tag saving
- Error with "go get..." HOT 6
- Current state of Ponzu HOT 1
- Is this project still maintained? HOT 3
- Suggested install method no longer works HOT 2
- Is Ponzu dead? HOT 10
- Potential goroutine leak in achive.go
- How can you develop addons more efficiently?
- How to setup development env
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ponzu.