GithubHelp home page GithubHelp logo

Comments (6)

ryantrinkle avatar ryantrinkle commented on September 3, 2024 2

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.

pheara avatar pheara commented on September 3, 2024 1

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.

  1. Basically i created an app along the lines of main = run 8081 $ mainWidget $ el "input" blank
  2. compile it with ghcjs
  3. in the resulting, generated html add an <input> with an initial value / content
  4. run the app
  5. 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.

pheara avatar pheara commented on September 3, 2024

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.

ryantrinkle avatar ryantrinkle commented on September 3, 2024

@m0ru Agreed!

Also, you might be pleasantly surprised to learn that reflex-dom has supported static rendering for quite some time.

from jsaddle.

pheara avatar pheara commented on September 3, 2024

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.

ryantrinkle avatar ryantrinkle commented on September 3, 2024

@m0ru Ah, interesting. I'd love to know what you ran into - maybe it's stuff we can fix!

from jsaddle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.