←back to thread

193 points yaoke259 | 6 comments | | HN request time: 0.769s | source | bottom
1. mirkodrummer ◴[] No.45026005[source]
So we have the following layers:

- One that parses markdown text and generates javascript code, be it React, Svelte or whatever. It must generate compiled react/svelte source, e.g. it cannot generate JSX

- The javascript code get executed at runtime which runs the chosen framework, but without a build step such frameworks won't generate optmized code. In the case of React even gives you the illusion that HTML rendering is in immediate mode but it actually

- Keep another layer that diffs some tree data in memory that eventually generate/manipulates DOM nodes which is retained mode rendering

- Which in turn calls native bindings with the rendering engine(be it Skia or whatever)

- Which in turn calls OS apis and so on...

I'm asking sincerely: where are we going?

replies(2): >>45026038 #>>45026407 #
2. yaoke259 ◴[] No.45026038[source]
I'm already looking at a v2 implementation as some others have correctly pointed this out. Since I'm already relying on customElements and web components, I should make that first class and change the framework implementations into thin wrappers. V2 will be pure js custom elements which can fall back to native html. wrappers will be even more lightweight. Hopefully this design is a strict win
replies(1): >>45026229 #
3. mirkodrummer ◴[] No.45026229[source]
Custom elements/web components are just another layer of abstraction, and I'm also wondering "V2 will be pure js custom elements which can fall back to native html" how would you fall back to native html? custom elements depends on javascript, it's end game otherwise, you could setup some fallback markup but with no interaction
replies(1): >>45026597 #
4. DetroitThrow ◴[] No.45026407[source]
Testing myself, it seems to not work after a certain period of time - I'm curious what layer OP would start debugging this in or whether they should just do an entire rewrite!
replies(1): >>45026520 #
5. yaoke259 ◴[] No.45026520[source]
am going to do a rewrite for v2. For some reason custom elements and astro don't play well with each other for me. I believe this issue does not happen on Sveltekit, Next etc. but this project is very young so bear with me
6. yaoke259 ◴[] No.45026597{3}[source]
Yes fallback markup is what I meant, and yes, it would not be super useful if JS is entirely disabled. I figured custom elements would be good since they can encapsulate state and styling, allowing for slightly more sophisticated behaviour compared to raw dom elements