elem-go icon indicating copy to clipboard operation
elem-go copied to clipboard

gen the whole html5 model

Open gedw99 opened this issue 1 year ago • 15 comments

https://github.com/delaneyj/gostar is a htmx style system that has strong typing support for all the of the html5 standard:

Its generated to here: https://github.com/delaneyj/gostar/tree/main/elements

It looks like its not that hard to reuse this as a basis to gen into https://github.com/chasefleming/elem-go/blob/main/elements.go

Then every possible html5 element and attribute is covered and strongly typed.

cc @delaneyj

gedw99 avatar Feb 06 '24 14:02 gedw99

I agree @gedw99 strong typing on the elements would be nice. I have been thinking about how to do it without burdening the user to know many different types given this library follows a different pattern. It would be a breaking change though so I'm delaying implementing it most likely until a v1 or near that.

chasefleming avatar Feb 06 '24 19:02 chasefleming

I build off the HTML/SVG specs... If you have ideas around this @chasefleming I'm happy to collab

delaneyj avatar Feb 06 '24 19:02 delaneyj

I'll put together my thoughts on what I was thinking for the pattern and post it soon to get feedback from you all.

chasefleming avatar Feb 06 '24 23:02 chasefleming

@gedw99 just to clarify regarding this issue so I can address it properly, are you looking for the elements to have type safety in terms attributes or looking for a component library on top of this library?

chasefleming avatar May 10 '24 02:05 chasefleming

Yep, I agree. Funny you should mention that @gedw99 , because I'm actually working on a separate component library with this library as its base. It's not ready yet, but I can make it public early if you want to start using it in its early form. If anyone else is reading this though, I highly encourage as many component libraries as possible to be built on top of this one. The more the merrier.

chasefleming avatar May 11 '24 13:05 chasefleming

@gedw99 sounds good. I'll post something as soon I have it ready to use in an alpha state. Will speed up my development now that I know someone needs it :)

chasefleming avatar May 16 '24 17:05 chasefleming

So, @gedw99, would you prefer an elem-go component library that has simple-to-use components—you just pass in your arguments and receive updates and bug fixes, similar to Chakra UI—or a tool like Shadcn that generates the component files for you and allows complete customization because you have the code, but doesn't provide updates and bug fixes?

chasefleming avatar May 18 '24 16:05 chasefleming

The component library I'm building is built on top of elem-go, with the overriding of styles and attributes available through the component props, but I guess I don't see a need a CLI or component library have to be separate. Once one is built, the other can write them into files if a developer prefers that approach.

chasefleming avatar May 31 '24 23:05 chasefleming