GithubHelp home page GithubHelp logo

Comments (5)

glennfu avatar glennfu commented on June 16, 2024

I just updated to the latest 0.8.3 release and I think this is closer. However upon inspection I believe Turbolinks is using Element.prototype.replaceChild to make changes, which is a different function from what turbo-react replaces: document.documentElement.replaceChild. This might be just in my case of it performing a "changes" operation instead of loading the full page.

from turbo-react.

glennfu avatar glennfu commented on June 16, 2024

I tried updating turbo-react to also overwrite Element.prototype.replaceChild and then trigger with Turbolinks.replace(html, { change: ['target'] }) but got this error:

"Warning: React attempted to reuse markup..."

However, it seems it just removes my element #target from the dom entirely. I'm not savvy enough with React to guess a solution for this.

For any Turbolinks action other than 'change' it looks like Turbolinks now calls document.body = body. I think the monkeypatch from here on out isn't a viable option. Bummer!

from turbo-react.

ssorallen avatar ssorallen commented on June 16, 2024

Thanks for looking into edge Turbolinks, @glennfu. I am going to figure out how to build on top of it.

from turbo-react.

glennfu avatar glennfu commented on June 16, 2024

@ssorallen On a related note, check this conversation: turbolinks/turbolinks-classic#628

Turbolinks 5 will be coming by the end of the year along with Rails 5, and they're debating whether or not to even bother continuing with Turbolinks 3. So with that in mind, by the time you (or I) figure out how to properly integrate with Turbolinks 3, Turbolinks 5 will be out! I get the sense that because it's a complete rewrite, the difference between 3 and 5 won't just be about updating the code, but about re-thinking for a new strategy of behavior.

It's still in very early development if you check out the current code here: https://github.com/basecamp/turbolinks. The way they describe the effort, I think it'll include much better hooks for interacting with it. This might give us what we need for dropping in React to do the rendering, vs trying to hack Turbolinks 3 into having those kinds of hooks. Since the dev is so early I'm not certain about that point, though.

from turbo-react.

ssorallen avatar ssorallen commented on June 16, 2024

This was fixed in react-magic#35 and is not an issue with the released Turbolinks v5.0.0.

from turbo-react.

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.