Comments (5)
@johnloy thanks! Very exciting and thanks for offering to pitch in! We can use all the help we can get and currently we are not working on any specific SSR/Hydration — although @danielroe had mentioned being interested in tackling this challenge as well.
Behind the scenes, ArrowJS is mid-stream on a big refactor (with essentially the same API) to significantly boost performance and code readability (its a bit of a jumble right now, more of a proof of concept experiment) — but one of the major things that we are trying to at least consider in this refactor (to be fair, more like a rewrite) is how we could do SSR and hydration in a highly efficient manor. Specifically, since we don’t use a Virtual Dom, its completely possible to ship only the rendered DOM and the expressions that bind to those elements, eliminating the double-html problem.
From a pure SSR perspective Arrow can technically render server side using JSDom "out of the box" — of course, thats not going to be particularly performant. It seems to be something similar could be done by mocking the very small surface area of web API calls Arrow uses to just perform some basic string manipulation and concatenation — or maybe there is a better way 🤷♂️
It’s not a problem I've spent much time tackling myself yet, so I would need to approach it with a big slice of humility.
So I guess — yes — please help with SSR and hydration, but I would hate for you to spend much time getting it to work using the current internals. Perhaps we resurrect this thread in a few weeks when we have that stable refactor.
from arrow-js.
@justin-schroeder @andrew-boyd Fantastic work, and thanks for advocating for simplicity and the platform ™️ !
I'm interested in the challenge of developing Arrow integration with Astro, ala https://docs.astro.build/en/guides/integrations-guide/lit/. SSR/hydration support are part and parcel of that. Is there perhaps an opportunity for me to try my hand at this, or is this something you already have in the works?
from arrow-js.
Wonderful! Speaking of humility, I don't claim to have any big ideas or applicable experience 😬. I'm just very excited by the challenge, and the opportunity to help. That said, I did once start a since-abandoned effort to create a one-size-fits-all SSR/SSG renderer for custom elements using JSDOM (you're right, it's probably not the most performant way). Maybe there's something in there that's useful?
https://github.com/johnloy/static-shadow-dom (the README is a mess)
In any case, thanks for the quick response, and the heads up about the rewrite. For the time being, I'll take a closer look at the current source, to get some ideas flowing. I'm guessing the arrow-refactor-x
branches are where the rewrite is happening?
from arrow-js.
one of the major things that we are trying to at least consider in this refactor (to be fair, more like a rewrite) is how we could do SSR and hydration in a highly efficient manor. Specifically, since we don’t use a Virtual Dom, its completely possible to ship only the rendered DOM and the expressions that bind to those elements, eliminating the double-html problem.
This sounds fairly similar to an idea @ryansolid has been pontificating on recently for Solid: a sort of "on-demand, partial tree" hydration. You can essentially completely eliminate shipping templates to the client for anything besides structural changes by lazily recreating the reactive graph when global event listeners are triggered. These ideas might be worth considering for Arrow since it seems to handle reactivity similarly to Solid: https://hackmd.io/@0u1u3zEAQAO0iYWVAStEvw/Hyu_IZQq2
from arrow-js.
Thank’s for the link @markmals!
from arrow-js.
Related Issues (20)
- TypeScript type for nested, optional reactive objects is broken HOT 1
- FYI: textarea behavior is very funky if you try to put HTML inside it rather than using the 'value' attribute HOT 2
- [Question] Are there ways to integrate with hyperscript interfaces? HOT 4
- Script throwing "Illegal Invocation" when adding an object to a reactive array HOT 2
- How does watch function work? HOT 2
- Cross-Site Scripting Vectors (XSS) HOT 5
- Dark mode flashbang 🫣 HOT 1
- Rewrite a reactive property which has $on event throw error
- [bug] Docs navigation indicator is bugged scrolling past "Getting Started" HOT 1
- Element property syntax not working HOT 1
- Map, Set, WeakMap, WeakSet can't be wrapped successfully HOT 4
- Nested template being called unexpectedly HOT 2
- Array of text boxes without a good key? HOT 2
- Poor performance? HOT 1
- What are the rules for `reactive`? Can I use es2015 classes in my "state" HOT 4
- Binding reactively to array length HOT 2
- How to unwatch HOT 2
- Component that changes a sub-property of its own state object by async method re-renders the whole component in an infinite loop HOT 6
- Can it support the CommonJS
- Component from the DOM HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arrow-js.