
Introduction
Lazy hydration for Vue SSR.
NOTE: This project uses @znck/prop-types which generates tree shakeable component prop definitions but it requires
process.env.NODE_ENV
to replaced with"production"
to work effectively. See @znck/prop-types's documentation to know more.
Usage
Installation
npm install --save lazy-hydration
Examples
; ... components: Hydrate ...
Examples of using Hydrate in a Vue component, which also documents the different options provided:
<!-- Hydrate when user clicks. --> <!-- Just in time hydration. When user hovers over content --> ... <!-- Hydrate on any event --> ... <!-- or events --> ... <!-- When user hover over or keyboard focus into. --> ... <!-- Requires IntersectionObserver. Polyfill not included. --> ... <!-- Requires requestIdleCallback. Polyfill not included. --> ... <!-- Only in SSR. --> ... <!-- Scheduled hydration. In 2s of initial render. --> ... <!-- Controlled hydration --> ...
Programmatic approach:
...
NOTE: Consider BETA until v1.0 release.
Prior Art
- vue-lazy-hydration by Markus Oberlehner
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Author
lazy-hydration © Rahul Kadyan, Released under the MIT License.
Authored and maintained by Rahul Kadyan with help from contributors (list).
znck.me · GitHub @Rahul Kadyan · Twitter @znck0