usebedrock / bedrock

Bedrock is a static site generator to create large-scale HTML prototypes and document design systems
https://bedrockapp.org
Other
206 stars 28 forks source link

Bedrock 2.0 #191

Closed Wolfr closed 4 years ago

Wolfr commented 6 years ago

After 2+ years of Bedrock I think is is time to start thinking about Bedrock 2.0.

Here are some of my main ideas. Any suggestions are welcome.

Javascript loading

I need some help in figuring out what to modernize, because I am out of touch with some of the recent evolutions in the Javascript world.

Make it easy to integrate Bedrock results into React/Angular 5

Can we somehow make it easier to integrate into modern stacks using React or Angular 5?

Can we build a similar compiler/logic where styles are confined to the objects themselves or is this really crazy/too much work?

Template language change

I know what I want, which is essentially the same functionality as Bedrock 1.0, but it should be more approachable to a broader group of people. So one idea that I had is getting rid of Pug/Jade.

Even though I have grown to love it, there is something to be said about easily being able to copy paste HTML/CSS to an implementation. I have little experience with it but what I've seen from Nunjucks is quite cool


I think when we know what we want, we can start planning its development. It maybe doesn't have to be now, but I would like to keep evolving this project over time.

Your input is welcome!

xavez commented 6 years ago
Wolfr commented 6 years ago

What exactly do you mean with "JavaScript loading"?

I have the feeling our methods (RequireJS?) are a bit out of date. Not sure though as like I said I am a bit out of touch with modern JS methods to include libraries/files. Related issue #184 .

Wolfr commented 6 years ago

The ability to use JavaScript in template logic is pretty damned cool.

This is also a feature of Nunjucks btw.

xavez commented 6 years ago
Wolfr commented 6 years ago

What I found when I was building a styleguide for the Mono website (which is mostly PHP and HTML) it was super annoying to convert to .pug.

So I made an experimental repo where I changed the template language over to Nunjucks. It is completely broken at the moment but swapping it out doesn't seem as much work as I anticipated.

What I am thinking is that if I have to explain Bedrock to someone with just base HTML/CSS experience, at least they don't have to jump over the gap to learn Pug.

I really believe a templating language that is closer to HTML will increase possible adoption.

It also allows you to easily copy/paste things from other libraries to start creating Bedrock docs e.g. you could just go to material.io and start copy/pasting 1 by 1 to build your library of UI elements.

I also researched the usage of inline Javascript in Nunjucks, and while I said it's possible to use inline JS in Nunjucks, it turns out to not really be the case.

Nunjucks explicitly doesn't do this to confine itself to templating. But what use case are you thinking about where you need to do inline JS? You can set variables, work with JSON data etc. in Nunjucks no problem. You can't do something like Date.now() but there are ways around it.

Wolfr commented 4 years ago

In the end, the solution was to use the frameworks built around the tech stacks and implement Bedrock's functionality in them (and not the other way around), as per this spec.