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

@neura-studios/flash-list

v1.0.0-rc.2

Published

A better list for React Lua

Downloads

4

Readme

⚡ FlashList Lua

WebsiteDiscordGetting startedUsagePerformanceWriting performant componentsKnown Issues

Fast & performant React Roblox list. No more blank cells.

Swap from FlatList in seconds. Get instant performance.

Installation

FlashList Lua supports installation via NPM or Wally.

NPM

npm add @neura-studios/flash-list

yarn add @neura-studios/flash-list

Wally

[dependencies]
FlashList = "neura-studios/flash-list@^1.0.0"

Usage

We recommend reading the detailed documentation for using FlashList here.

But if you are familiar with FlatList, you already know how to use FlashList. You can try out FlashList by changing the component name and adding the estimatedItemSize prop or refer to the example below:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Packages = ReplicatedStorage.Packages
local React = require(Packages.React)
local FlashList = require(Packages.FlashList)

local e = React.createElement

local DATA = {
    {
        title = "First Item",
    },
    {
        title = "Second Item",
    },
}

local function MyList()
    return e(FlashList.FlashList, {
        data = DATA,
        estimatedItemSize = 200,
        renderItem = function(entry)
            local item = entry.item
            return e("TextLabel", {
                AutomaticSize = Enum.AutomaticSize.XY,
                Text = item.title,
            })
        end,
    })
end

To avoid common pitfalls, you can also follow these steps for migrating from FlatList, based on our own experiences:

  1. Switch from FlatList to FlashList and render the list once. You should see a warning about missing estimatedItemSize and a suggestion. Set this value as the prop directly.
  2. Important: Scan your renderItem hierarchy for explicit key prop definitions and remove them. If you’re doing a .map() use indices as keys.
  3. Check your renderItem hierarchy for components that make use of useState and verify whether that state would need to be reset if a different item is passed to that component (see Recycling)
  4. If your list has heterogenous views, pass their types to FlashList using getItemType prop to improve performance.
  5. Do not test performance with React dev mode on. Make sure you’re in release mode. FlashList can appear slower while in dev mode due to a small render buffer.

Unsupported Features

Not all features from FlashList or recyclerlistview are ported in this translation. Some notable exclusions are:

  • RefreshControl currently has no implementation in Axon. That's currently blocking refresh gesture support in this package.
  • Item animators aren't currently supported because there's no clear path for how to animate item layouts and entry/exist animations in Roblox. Could likely be revisited later if we come across a need for this.
  • Inverted lists aren't currently supported because Roblox lacks the matrix transforms used in upstream to make it work and I don't have the time to work out an alternative path. We don't have a use case for this.