Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render the components as partials. #399

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

thusc
Copy link
Contributor

@thusc thusc commented Jul 14, 2021

See #391 for a discussion.

This is currently only done in the build step, and not for the the live development server.

Let me know if you prefer to have the code for the live development server in the same PR; I guess I can have a look at it too.

And maybe you'd like an example use case with htmx before merging ? Or small PRs like these are fine ?

(Btw this is extracted and modified form the https://github.com/thusc/bedrock/tree/cli branch you saw before, but maybe this one will take more time and I prefer to separate different features.)

Here is an example file:

$ cat dist/partials/cc-example/01-my-component.html 
<div class="example">
    <p>This is an example component.</p>
</div>

Edit: here is the same example on the automated Vercel deployment: https://bedrock-git-fork-thusc-render-partials-monocompany.vercel.app/partials/cc-example/01-my-component.html

@vercel
Copy link

vercel bot commented Jul 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/monocompany/bedrock/mKvequ1nraX62q72pesRr5S7i92c
✅ Preview: https://bedrock-git-fork-thusc-render-partials-monocompany.vercel.app

@Wolfr
Copy link
Contributor

Wolfr commented Jul 14, 2021

Very cool! 😍

To merge PR the functionality I would like it to be behind a flag.

What if the logic of putting it behind the styleguide: false config option at this point?

https://github.com/usebedrock/bedrock/pull/399/files#diff-25789e3ba4c2adf4a68996260eb693a441b4a834c38b76167a120f0b51b969f7R52-R57

If you could implement a config flag that enables this option separately (e.g. renderPartials), I can add it to the docs.

Then we can default it to false. This way it can continue to be developed and it's not in anyone's way.

@thusc
Copy link
Contributor Author

thusc commented Jul 14, 2021

Done.

(It was actually not behind de styleguide flag: it was built whether or not that flag was set. In my mind, the partials might be used in the regular prototype, outside the styleguide.)

(When you change the doc, note that the doc talks about config.js instead of default-config.js at the top of that page.)

@thusc
Copy link
Contributor Author

thusc commented Jul 18, 2021

@Wolfr Can you put this PR on hold, until #404 and the CLI things are merged ? it will be cleaner to first have those before adding a new feature.

@Wolfr
Copy link
Contributor

Wolfr commented Jul 19, 2021

@thusc OK, noted!

@Wolfr Wolfr added the onhold label Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants