npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-synchronous-list

v0.2.1

Published

A react-native list (for iOS only) that renders it's children synchronously

Downloads

10

Readme

react-native-synchronous-list

Consept

What:

This is an infinite list implementation that uses a template defined in javascript to render it's (native) children through an interesting mechanism called synchronous rendering first envisioned by Tal Kol from wix.

Why:

Because trying to render children on the fly while scrolling sends to much information through the RNBridge and blocks it. As a result we see a white flicker when scrolling fast, plus it doesn't give the native feeling that native lists give.

How:

  • When the app starts we register a component "template" that we'll be using as our row view of our native list.
  • We then create a set of instructions so that the native side knows how to convert that template into a native view
  • Finally we use the list like a typical native UI component

Here's his initial proof of concept project:

Installation

1 . $ npm install --save react-native-synchronous-list

or

$ yarn add react-native-synchronous-list

2 . $ react-native link react-native-synchronous-list

3 .  Run the project

You should able to see this:

iOS | Android :-------------------------:|:-------------------------: |

Caution

That's still a WIP project and you should definitely not use it as it is on production apps.

Typical usage

Step 1:

Basically you first register a template synchronously by invoking the SyncRegistry.

Here's how a template looks like and here's where we register it.

So we'll declare that jsx template and the native code will create a recipe out of it. Next time we want to create that view, the native code will create a new view based on that recipe (without the need to go to javascript) - it all happens on the native side now.

Step 2:

Prepare the native component for rendering

this.synchronousList.prepareRows();

In the example we just do it whenever we first get a ref of the list.

Step 3:

Then all you have to do is render the list like a normal js component.

Available props

| Name | Type| Description | Default | | --- | --- | --- | --- | | data | array | REQUIRED The data that we'll be mapping to our views | - | | numRenderRows | number | REQUIRED The total views we'll be re/using (this list is recycling views remember?). Choose a value that's big enough so that the rows cover at least 1 screen. | - | | loopMode | string | Either no-loop (typical list), repeat-empty (a list that repeats empty views after we're out of data or repeat-edge (a least that repeats views that were in the beggining of our data once we're out of data (infinite loop mode) | no-loop | | horizontal | bool | Wether we'll be running the list in horizontal mode or vertical | false | | dynamicViewSizes | bool | True if we'll be calculating the row sizes based on the props data or false if we'll be using the rowHeight and rowWidth static values | false | | rowHeight | number | The height of each row when using the list in static row size mode. | - | | rowWidth | number | The width of each row when using the list in static row size mode. | - | | templateName | string | The name of the template object we'll be using. (No need to change that) | 'RNSynchronousListRowTemplate' |

Example

See the RNExample folder

Todo

| TODO | Status | | --- | --- | | Recipe registration implementation | ✅ | | SyncRootView implementation | ✅ | | RecyclerListView implementation | ✅ | | RecyclerListView row item item (extends SyncRootView) | ✅| | Reload working ( RN Issue here )| :x: |

License

MIT © Ioannis Kokkinidis 2017-2018