Comments (6)
It does replace with the dynamically generated one. It's careful to make sure the switchover is instantaneous, but it does not make any attempt to reuse existing elements. What we've done in the past is disable all input elements on the page using runInputDisabledT when drawing the page statically, so that the user can't start entering information until the JS loads.
It would be great if we could take over the DOM instead, but it would take some work to get there.
from jsaddle.
Hm, apparently I didn't commit that experiment to our project, but I can recreate it when I get to my own notebook where stuff is properly set up.
- Basically i created an app along the lines of
main = run 8081 $ mainWidget $ el "input" blank
- compile it with ghcjs
- in the resulting, generated html add an
<input>
with an initial value / content - run the app
- the initial value should be gone / overwritten by the starting app
What I wanted to test was, that if the app is send with statically pre-generated html, people start typing in the input-field (or textarea) and then the javascript finishes bootin and kicks in, that whatever people wrote isn't lost. Thus I wanted to check, whether the renderer merges changes over existing DOM or just replaces it with the dynamically generated one.
It was just a quick experiment though (I edited the generated html!) and I just might not have stumbled across a way to get this inflation to work properly.
Though this is actually I different issue. Should I repost it as such? (propbably rather to reflex-frp/reflex-dom
though, as -- i guess -- it's not directly a thing that jsaddle needs to / should resolve)
from jsaddle.
e.g. if the SPA uses "/"
, "/new"
, "/post/<postId>"
it would be nice to reload the page on any of these and continue debugging.
(our current work-around is to use fragment-identifiers; however, should reflex-dom implement static-prerendering javascript-less navigation becomes a possibility and fragment-identifiers are rather suboptial for that)
from jsaddle.
@m0ru Agreed!
Also, you might be pleasantly surprised to learn that reflex-dom has supported static rendering for quite some time.
from jsaddle.
ah, yes, i forgot ^^"
afair we tried it while setting up the project but ran into problems when inflating it on the client (using the static rendering as pre-render to speed up page-loading)
from jsaddle.
@m0ru Ah, interesting. I'd love to know what you ran into - maybe it's stuff we can fix!
from jsaddle.
Related Issues (20)
- jsaddle-warp: stopPropagation sometimes doesn't work HOT 2
- Static files HOT 1
- Support GHC-8.8 HOT 1
- jsaddle missing sync message handler HOT 3
- SPA routing HOT 4
- Using WebSockets with JSADDLE
- Maybe bump warp dep of jsaddle-warp on hackage HOT 1
- How to get result of promise/async function without a continuation Haskell function.
- Lots of ambiguous type errors when using OverloadedStrings
- TypedArray sliceIO is not exported
- Too strict version bound on ref-tf HOT 1
- How to run tests? `cannot satisfy -package lens-5.1` HOT 2
- jsaddle-warp restarts periodically
- jsaddle-warp performance with massive arrays (length == 518400)
- CC constructor type mismatch when using text-2.0.1 HOT 2
- Re-release jsaddle on Stackage HOT 1
- JSaddle for GHC Javascript Backend HOT 2
- lens-5.3 not allowed HOT 3
- Text function and emojis causes jsaddle errors in certain cases HOT 1
- jsaddle-warp browser DOS on the Haskell program (stuck on sendTextData) HOT 6
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 jsaddle.