Giter Site home page Giter Site logo

cubesquared / vertical-collection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from html-next/vertical-collection

0.0 0.0 0.0 9.54 MB

Infinite Scroll and Occlusion at > 60FPS

Home Page: https://html-next.github.io/vertical-collection/

License: MIT License

JavaScript 92.62% HTML 5.43% CSS 1.95%

vertical-collection's Introduction

vertical-collection

Greenkeeper badge

Build Status

Infinite Scroll and Occlusion at > 60FPS

vertical-collection is an ember-addon that is part of the smoke-and-mirrors framework. It focuses on improving initial and re-render performance in high-stress situations by providing a component for performant lists and svelte renders to match a core belief: Don't render the universe, render the scene.

TL;DR svelte render: the fewer things you need to render, the faster your renders will be.

Your web page is a universe, your viewport is the scene. Much like you wouldn't expect a video game to render out-of-scene content, your application should smartly cull the content it doesn't need to care about. Trimming excess content lets the browser perform both initial renders and re-renders at far higher frame-rates, as the only content it needs to focus on for layout is the content the user can see.

vertical-collection augments your existing app, it doesn't ask you to rewrite layouts or logic in order to use it. It will try its best to allow you to keep the conventions, structures, and layouts you want.

Install

ember install @html-next/vertical-collection

Usage

{{#vertical-collection
    items
    tagName='ul'
    estimateHeight=50
    staticHeight=false
    bufferSize=1
    renderAll=false
    renderFromLast=false
    idForFirstItem=idForFirstItem
    firstReached=(action firstReached)
    lastReached=(action lastReached)
    firstVisibleChanged=(action firstVisibleChanged)
    lastVisibleChanged=(action lastVisibleChanged)
     as |item i|}}
    <li>
      {{item.number}} {{i}}
    </li>
{{/vertical-collection}}

Actions

firstReached - Triggered when scroll reaches the first element in the collection

lastReached- Triggered when scroll reaches the last element in the collection

firstVisibleChanged - Triggered when the first element in the viewport changes

lastVisibleChanged - Triggered when the last element in the viewport changes

Support Matrix

vertical-collection version Supported Ember versions
^v1.0.0 v1.12.0 - v3.8.0
^v2.0.0 v3.8.0+

Support, Questions, Collaboration

Join the Ember community on Discord

Features

Infinite Scroll (bi-directional)

Infinite scroll that remains performant even for very long lists is easily achievable with the vertical-collection. It works via a scrollable div or scrollable body.

Svelte Everything

If it can be trimmer, smoke-and-mirrors likes to trim it.

Status

Changelog

Build Status dependencies devDependency Status Coverage Status

Documentation

For updated documentation and demos see http://html-next.github.io/vertical-collection/

Contributing

  • Open an Issue for discussion first if you're unsure a feature/fix is wanted.
  • Branch off of master (default branch)
  • Use descriptive branch names (e.g. <type>/<short-description>)
  • PR against master (default branch).

Testing

Make sure you register the test waiter from ember-raf-scheduler. So ember-test-helpers's wait is aware of the scheduled updates.

An example can be found here

License

This project is licensed under the MIT License.

vertical-collection's People

Contributors

runspired avatar pzuraq avatar kylemellander avatar greenkeeper[bot] avatar robbiethewagner avatar billy-addepar avatar aquamme avatar srowhani avatar cyril-sf avatar adamjmcgrath avatar davidgoli avatar gaurav0 avatar sreedhar7 avatar ssendev avatar alexander-alvarez avatar twokul avatar xomaczar avatar bgentry avatar bryancrotaz avatar ctjhoa avatar cball avatar conorlinehan avatar ewhite613 avatar gavinjoyce avatar g-cassie avatar h2blake avatar luxzeitlos avatar waffle-iron avatar fsmanuel avatar localpcguy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.