What UI framework? #26
justinmchase
started this conversation in
General
Replies: 1 comment 2 replies
-
Thank you for your interest in this library! The use case for this library is when large frameworks are "overkill". Having said that, some UI library should work with this library.
// index.html
<script src="./main.ts" type="module"></script>
<div id="app"></div>
// main.ts
import { render } from 'https://esm.sh/preact@10.12.1';
function App() {
return (
<p class="big">Hello World!</p>
)
}
render(<App />, document.getElementById("app"));
// index.html
<script src="main.ts" type="module"></script>
<my-element></my-element>
// main.ts
class MyElement extends HTMLElement {
connectedCallback() {
this.textContent = "hello";
}
}
customElements.define("my-element", MyElement); I think other libraries that are complete on the client side and distributed from a CDN will probably work as well. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really like this approach, it really seems like the right way to be doing ESM in the browser.
But my next question is what UI framework would work well with this? Many big UI frameworks these days have their own compiler / bundler and webserver. Supposing I don't like any of that and would rather just use this, what UI framework works well with just focusing on the UI framework in the UI without bundling at all?
Beta Was this translation helpful? Give feedback.
All reactions