Sitename

Support other Templating Engines like React · Discussion #8 · livebud/bud


Right now Bud ships with out-of-the-box Svelte support. It's also designed to support React.

I picked Svelte because it already has solutions for scoped CSS and dynamically changing the <head>. I'm tempted to wait on introducing React support until we have both of these features. Something like including Next.js's styled-jsx + <Head/>. Is this worth waiting for or does it not matter?

Admittedly while Svelte is growing rapidly, React is the standard here and we need to meet people where they are.

I'd also like to support 2 other templating languages:

Which probably wouldn't ship with scoped CSS support (or should they?). That make me wonder what "baseline" of support I should provide and starting with basic React, then adding scoped CSS + dynamic head later would be desired.

Replies

Is there a mailing list I can sign up for so I can get updates on the project? I subscribed to the github releases too :)

@matthewmueller

Not yet, this blew up more than I anticipated! Can you send me a quick email to hi@livebud.com? I'll add you to a list manually for now :)

First of all, congrats for the project; it looks awesome and quite promising!

Since you have mentioned the possible plan to support React, logically the next thing would be to support Vue as well.

Sounds fair, right?

Now a naive question here: how difficult would it be to go full vanilla JS instead of depending on third parties and such, whenever is necessary that is?

Also, about using Go's html/template, yes please! That would be really cool, especially for those users who use Hugo; they can bring in their existing experience without worrying they need to learn something new.

Edit: Seems like @josebalius asked the same thing as I in #23.

@matthewmueller

Sounds fair, right?

Definitely fair, but I might need to be convinced on this one 😅. I haven't played with Vue yet, but just through internet osmosis, my current feeling is that it's a blend between React and Svelte. I'm not sure what it brings to bear on it's own. I'm pretty sure my view is wrong because it seems like a lot of people like Vue so I hope to be proven wrong!

Also, about using Go's html/template, yes please! That would be really cool, especially for those users who use Hugo; they can bring in their existing experience without worrying they need to learn something new.

Yes, I actually already had support for this but removed it after adding Svelte support (and prepping React support). It would have required a large refactor that I wasn't prepared to do at that time. I'm hoping to get it added back in soon!

Edit: Seems like @josebalius asked the same thing as I in #23.

Answered!

@matthewp

@matthewmueller would it be possible to have a concept of "renderers" through the plugin API? Maybe it would map a file extension to a function that implements whatever template API it is that Bud needs? That way you could support any frontend framework via plugins. I work on Astro and this is what we do.

Either way I do think including React by default makes a lot of sense for popularity reasons.

@matthewmueller

Hey @matthewp, nice to see you here!

Bud indeed has a rudimentary plugin system. I took it just far enough to know I could render both Svelte and React. It sounds like I should be studying Astro for a more complete solution. Could you point me in the right direction where I can learn more?

Not interested in React and any JS trash (I mean it. fight me.), just bare HTML. Does bare HTML belong in this issue or should it be a new one?

@matthewmueller

There will be no fighting here 😇

I just split HTML support into a new discussion: #40

@donuts-are-good