Comments (2)
With regard to ‘document transitions’, and in the context of a Mithril SPA, we’d have all route endpoints resolve to the same reference, whose view would persist across the entire application lifecycle. This ‘transition layout’ would instantiate the Mobile
controller for all Unit
s that desire to persist between different pages.
In the case of the example application demonstrated in Googles recent page transitions presentation, the prime example is a video component: there is a video whose UI view model we want to persist between different pages. On a very basic level, we want the user to be visually aware of that particular video which occupies the major part of the layout on page 2, being the same video they presumably clicked on from several in a list displayed on page 1. The page layout will change drastically, and the videos position within it, but according to the users mental model it is the same video. Mobile Unit
allows us to structure our view model such that this identity persists; we can keep all component state & the video element itself and move them from one structure to another, even as the old is structure is destroyed and the new created — the *transition
API allows us to hook into the moment of movement & describe the transition as we see fit to represent it adequately to the user.
from mithril-machine-tools.
The ‘transition layout’ acts as a conceptual amalgamation of concerns here: in a simple 2 page application it would not be too difficult to conceive of a single component containing the logical expressions which determine whether the same identifiable Unit
ought to be rendered as part of structure 1 (the list) or structure 2 (the single-video page).
This cuts across Mithrils canonical route idiom whereby different pages are defined with different endpoints before any common view expressions can be described. Nonetheless, we can invert and later revert the order of control such that routing concerns are forked within the Mobile
expression, and the controlled Unit
reference is thereby able to be passed in to externally-defined, route-specific components: the author can then stick with the more familiar idiom of distinct view expressions for distinct pages, while still keeping the persistent references necessary to keep state & DOM live & transitionable despite their distinct positions being described in different execution contexts …
from mithril-machine-tools.
Related Issues (18)
- (Portal) Placeholder DOM is pointless HOT 1
- (Island) Islands must produce DOM for bottom-up root identification to work HOT 1
- v0.2x support? HOT 1
- npm usage? HOT 3
- Should inline support POJO's? HOT 1
- Docs! HOT 1
- Alternative Waiter logic HOT 2
- No matching export for import "Liminal" HOT 1
- Support multiple classes for Liminal HOT 3
- Mobile Unit reconciliation bug HOT 1
- Typescript definitions
- Link to flems for sample usage HOT 2
- Fix Island redraw function overload
- Island vtree patching is broken, fails on subsequent global draws HOT 1
- Develop Router component? HOT 1
- (Island) Using `m.render` on intervening DOM nodes is overly complicated and redundant HOT 4
- (Portal) Outlet should only render a placeholder node on initialisation 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 mithril-machine-tools.