A solution to help consume npm packages and js/css interoperability in general #2213
Madoshakalaka
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
Awesome idea ❤️ |
Beta Was this translation helpful? Give feedback.
2 replies
-
I decided it should be called |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A recent yew project of mine had to interoperate a lot with third-party js and CSS, while there wasn't an existing way to easily consume them. A solution was developed to have an
Agent
/Context
insert the libraries into the<head>
as<link>
s, wait for load, and notify consumers. It worked beautifully and I'm currently working on extracting it for everyone to use.I'm naming it
Yewt
, which means "eat", which means "to consume". Cuz it helps with the consumption of CSS and js libraries.Here's the API I'm thinking of:
a
<LinkResourceManager>
is going to be a context that stores the status of the links.use_links
is going to return abool
that becomes true when all dependencies are ready.declare_links!
is going to be a helper macro to declare the dependencies of each library.I am in the process of extracting the crate. I imagine portals implemented by #2147 will make this more yew idiomatic with less
web_sys
juggling. Let me know what you think!Beta Was this translation helpful? Give feedback.
All reactions