Comments (5)
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.
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.
Thanks for looking into edge Turbolinks, @glennfu. I am going to figure out how to build on top of it.
from turbo-react.
@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.
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)
- Back button is busted
- Does not work in iOS Chrome
- Breaks when using inline SVGs HOT 4
- Using Turbolinks events and options HOT 3
- Expose Turbolinks as global for configuration HOT 1
- Exceptions should trigger normal pageload
- Issue with addEventListener("click") on link HOT 11
- Remove bundled Turbolinks
- Considerations for moving this beyond an experiment? HOT 11
- Replace `replaceChild` monkeypatch HOT 2
- Body CSS classes not being updated HOT 17
- <textarea> and <pre> content is not converted properly HOT 12
- Updating form fields HOT 2
- react components don't load HOT 1
- Mutations in page not reflected in the virtual DOM HOT 4
- Turbolinks 5 HOT 3
- global is not defined error HOT 5
- Can turbo-react be used when using webpack
- Integrate HTMLtoJSX for proper JSX conversion HOT 1
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 turbo-react.