Show HN: Copper – A Go framework for your projects
11–20 of 86 posts
Re: Show HN: Copper – A Go framework for your projects
#12The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model" being fed to the template(s) via a state object passed by the application.
So I may have a few dozen template files in a folder called /components, and another folder called /pages with a few templates that use these components. When a user visits a "page", the template file is "compiled" with the appropriate components.
A page might look like this:
{{template "nav"}}
{{template "thread" .Thread}}
{{template "footer"}}
And "nav", "thread", and "footer" are all components defined in another file. This allows for re-use across multiple pages.I want to do a write-up on it but I'm not sure if it's a novel idea.
Re: Show HN: Copper – A Go framework for your projects
#13Re: Show HN: Copper – A Go framework for your projects
#14Earlier quoted context omitted.
>The main issue is that it doesn’t support placeholder values Can you elaborate? Like give me an example of a route path that uses placeholder values? I use Go to build web apps too and I really don't see a need for anything other than the standard library.
GET /{username}
Re: Show HN: Copper – A Go framework for your projects
#15but it could be decent choice if u want to build integrated framework i can understand why people would choose it, another option is code_generation_meta_hell with sqlboiler. upper db [0] would have been perfect fit for this kind of project but is not that famous, its development is slow but stable.
ps: i like sqlboiler what i am saying is if u are building framework top on it then not that fun
[0]: https://github.com/upper/db
edit: include link
Re: Show HN: Copper – A Go framework for your projects
#16Re: Show HN: Copper – A Go framework for your projects
#17Cool project. I'm currently building something similar to hacker news using only the standard library. How could this project help me? The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model"…
Re: Show HN: Copper – A Go framework for your projects
#18Re: Show HN: Copper – A Go framework for your projects
#19Cool project. I'm currently building something similar to hacker news using only the standard library. How could this project help me? The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model"…
But the tldr is - you'll need a lot more than just templating for a production ready app. To name a few things - server, storage, migrations, logging, configs. IMO there's a huge benefit in having a batteries included toolkit that stays close to the stdlib - so you can totally keep your templates as is!
Re: Show HN: Copper – A Go framework for your projects
#20this looks fine but not a fan of gorm. but it could be decent choice if u want to build integrated framework i can understand why people would choose it, another option is code_generation_meta_hell with sqlboiler. upper db [0] would have been perfect fit for this kind of project but is not that famous, its development is slow but stable. ps: i like sqlboiler what i am saying is if u are building framework top on it t…
My goal with Copper is to provide out-of-the-box integrations with popular solutions to various problems. For now, I picked GORM but I definitely see adding support for other tools.