ssorallen / turbo-react

A JavaScript library that transitions between static HTML pages on navigation; no app server required.
https://turbo-react.herokuapp.com/
Apache License 2.0
273 stars 16 forks source link

Decouple load from reactize #10

Closed hallgren closed 9 years ago

hallgren commented 9 years ago

The http://reactize-todo.herokuapp.com use the applyDiff directly on elements in the DOM and the applyBodyDiff breaks it.

ssorallen commented 9 years ago

I was hoping to keep turbo-react a drop-in library for transitioning between pages, so I'd like to keep the applyBodyDiff the default behavior. I do think it can support config though, something like the way Google Analytics enables config:

<script>
  (function(a) {
    a.config = { applyBodyDiff: false };
  }(window.Reactize || {}))();
</script>
<script src="/dist/reactize.min.js"></script>

Reactize would update to first look for a global Reactize object and see if a config exists that it should use. This will let you disable it and still keep the library as a drop-in tool.

ssorallen commented 9 years ago

Thanks for the suggestion. I am going to close this due to the reasons I listed in my previous comment. If you want to try out a config like I mentioned, I would look at merging something similar.

hallgren commented 9 years ago

I think you have a great aim with this project and I think I need to create a fork and make my changes there. For example I don´t use turbolinks and I want to control parts of the page not only the body tag.

I hope its ok if I steal your ideas and make some adjustments?

ssorallen commented 9 years ago

Definitely. I released this with an Apache License, so have at it. I'm interested to see where you go with this as well.

hallgren commented 9 years ago

Cool, thanks!