twbs / ratchet

Build mobile apps with simple HTML, CSS, and JavaScript components.
http://goratchet.com
MIT License
14.63k stars 1.45k forks source link

Extract DOM push.js transitions #683

Open ndelage opened 10 years ago

ndelage commented 10 years ago

Summary: Ratchet's view transitions (push.js) are a key for emulating the experience of a native mobile app, but they're tightly coupled with the PJAX approach to loading new content.

Problem: This is a major blocker for developers who want to render then display content on the client without a PJAX request (e.g. client side rendering with Backbone).

Proposed Solution: Separate the PJAX (AJAX, request caching & click/touch binding) and DOM transition responsibilities of push.js into two different files. Then expose a new function (like PUSH) that allows DOM replacement/transitions without retrieving new content via an AJAX request.

I've hacked together a solution for my own use, but I'd like to polish it and submit it as a pull request if the maintainers are interested. /cc @connors

miguelcobain commented 10 years ago

I also think this makes sense, although I'm not sure of what approach we would use. People are using ratchet in their Ember/Angular/Backbone apps and push.js is something that gets a bit in the way in those cases.

ndelage commented 10 years ago

I've submitted a pull request: https://github.com/twbs/ratchet/pull/684

Let's move the discussion there.