awesome build-less moon (+lazy load components?)
See original GitHub issueAwesome project! I was amazed how fast I could just get an index.html up and running, without having to install any transpiler (babel/webpack etc).
Question: what would you think of promise-support or url-support for the ‘view’-property?
So instead of
Moon({
root: "#root",
view: $('#view').innerHTML,
....
It would support:
Moon({
root: "#root",
view: Moon.component('view/myview.html') // moon evaluates promise
...
example (pseudocode):
Moon.component = (url) => {
return new Promise( (resolve,reject) => {
fetch(url)
.then( (d) => d.text() )
.then( resolve )
.catch(reject)
})
}
Why?
Many times i need to livecode HTML. Having the scalability of single-file-components, and not having to use the cli really speeds up the production i my case. Moon is so incredibly simple & easy to use, it kind of makes it sexy to not need an extra buildstep for single-file-components (like vue).
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
React Lazy Loading: The Best Complete Guide - CopyCat Blog
Learn how to optimize your app with a complete guide to React lazy loading and code splitting with coding examples, tips, videos, and...
Read more >Lazy loading React components - LogRocket Blog
Lazy loading enables you to render elements on demand, making your app more efficient and improving the user experience. How to use lazy...
Read more >Lazy load Angular components - Medium
Lazy loading so far — Lazy loaded routes. Lazy loading is a great feature. In Angular, we get it almost for free by...
Read more >Lazy Loading Individual Vue Components and Prefetching
In this article, we will explore which types of components can be loaded lazily and, more importantly, how to handle the waiting required ......
Read more >Does Angular Lazy Loading increase build time?
I just started in a project in Angular 12 where almost all components are in small modules that are lazy loaded.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad to hear @coderofsalvation @LeviSchuck!
I’ve tried it out on some small components and experiments, and you’re right haha — it’s very curryable and it’s super easy to create higher-order functions. Even though I created the new design, I haven’t explored its full potential.
I just committed the changes in 265252ed8145ffc75c227ca3232ce1b0074fcfbc, definitely one of my larger commits. Feel free to hop on the Slack and I can help you all try it out 😃
Moon v1 beta 3 is out! 🎉
Let me know what you think — I’m closing this for now because I think it can be achieved through Promises and returning an intermediate loading state inside a component function.