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

Shoelace integration #588

Open
Tracked by #197
RayyanNafees opened this issue Oct 25, 2024 · 4 comments
Open
Tracked by #197

Shoelace integration #588

RayyanNafees opened this issue Oct 25, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers Winter Of Code 4.0

Comments

@RayyanNafees
Copy link

Is your feature request related to a problem? Please describe.
yes, Using external web-component library like Shoelace
& how to implement your own Lit.js components instead of making from vanilla js

Describe the solution you'd like
Adding docs support & examples for shoelace like u added for tailwind

Describe alternatives you've considered
none

@aralroca
Copy link
Collaborator

@RayyanNafees, do you mean adding examples for use with the Brisa CLI? We can do it, sure. Of course, any PR to add examples will be very welcome, feel free to add examples.

About documentation, here is the documentation on how to add external WC:

And this how to compile WC from Brisa WC to use it in other frameworks or vanillajs:

@aralroca aralroca added documentation Improvements or additions to documentation good first issue Good for newcomers labels Oct 25, 2024
@RayyanNafees
Copy link
Author

No Actually integrating shoelace is quite complex thing to be done in frameworks, their Astro Integration also doesn't even function well despite being part of the official docs

The only way to use it is by Astrolace integration that does pretty decent job for it to be used with Astro

I would appreciate if the dev team does a test if it can be supported and hydrated over SSR with an example

@aralroca
Copy link
Collaborator

Ok, can be a great integration to have then. Thanks for the proposal

@aralroca aralroca added enhancement New feature or request and removed good first issue Good for newcomers labels Oct 25, 2024
@aralroca aralroca changed the title Shoelace Support in the documentation Shoelace integration Oct 25, 2024
@aralroca aralroca added the good first issue Good for newcomers label Oct 25, 2024
@aralroca aralroca mentioned this issue Oct 25, 2024
25 tasks
@aralroca
Copy link
Collaborator

aralroca commented Oct 26, 2024

I see that adding them in the _integrations file already makes that you can consume them in any page, server component or web component and you get the type-safe of them.

There are things to fix:

  • There is a warning in the terminal that should not come up.
  • It does not support SSR. I don't know if you can integrate the SSR of your Web Components.
  • It does not add the types of attributes.
  • Make it easier to add the Web Components to the _integrations file. The good thing about this file is that you can add all of them without any problem, and then you only import the ones you use during the build of Brisa.

Example Code

import type { WebComponentIntegrations } from "brisa";

import "@shoelace-style/shoelace/dist/themes/light.css";

export default {
  "sl-button": "@shoelace-style/shoelace/dist/components/button/button.js",
} satisfies WebComponentIntegrations;
Screenshot 2024-10-26 at 22 18 01

Result

Screenshot 2024-10-26 at 22 18 15

However, using Shoelance right now in Brisa is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers Winter Of Code 4.0
Projects
None yet
Development

No branches or pull requests

2 participants