Skip to content

Commit 81ff0f5

Browse files
authored
A bunch of fixes and performance improvements
Improve event emitter Update packages and switch builds to use vite Lint and code cleanup from package updates Improved flexbox performance - Also added optional useWebWorker setting for the flexbox plugin. This will load the yoga library in a web worker and do the calculations on the worker. At this moment, the postMessage command is too slow and will require some more work, but you may get some performance gains from offloading the calculations. Removed effects and replaced with shaders since lightning v3 removes effects Improved diff code and performance Improved focus performance Improved RN performance Some FlashList cleanup Bumping it causes linking issues with our RN client app Only lint before commit, run other checks before push
1 parent 4e58bb5 commit 81ff0f5

File tree

134 files changed

+5949
-4141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+5949
-4141
lines changed

.changeset/dirty-humans-hide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@plextv/react-lightning-plugin-flexbox": patch
3+
"@plextv/react-native-lightning": patch
4+
---
5+
6+
Flexbox performance improvements, and added optional useWebWorker option

.changeset/dull-plants-lie.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@plextv/react-native-lightning": patch
3+
"@plextv/react-lightning": patch
4+
---
5+
6+
Various performance improvements

.changeset/kind-mammals-hammer.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
"@plextv/vite-plugin-react-reanimated-lightning": patch
3+
"@plextv/vite-plugin-react-native-lightning": patch
4+
"@plextv/react-native-lightning-components": patch
5+
"@plextv/react-native-lightning-example": patch
6+
"@plextv/react-lightning-components": patch
7+
"@plextv/vite-plugin-msdf-fontgen": patch
8+
"@plextv/react-native-lightning": patch
9+
"@plextv/react-lightning-plugin-css-transform": patch
10+
"@plextv/react-lightning-example": patch
11+
"@plextv/react-lightning-plugin-flexbox-lite": patch
12+
"@plextv/react-lightning-plugin-reanimated": patch
13+
"@repo/typescript-config": patch
14+
"@plextv/react-lightning": patch
15+
"@plextv/react-lightning-plugin-flexbox": patch
16+
"@repo/vite-config": patch
17+
"@plextv/react-lightning-storybook": patch
18+
---
19+
20+
Switch builds to use vite and update packages

.changeset/tall-showers-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plextv/react-lightning": patch
3+
---
4+
5+
Removed effects and improved shaders

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
pnpm check:types
21
pnpm lint
3-
pnpm test
4-
pnpm unused

.husky/pre-push

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pnpm check:types
2+
pnpm test
3+
pnpm unused

.mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tools]
22
pnpm = "9.12.1"
3-
node = "20.11.1"
3+
node = "22.17.0"

apps/react-lightning-example/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": {
1212
"url": "https://github.com/plexinc/react-lightning/issues/new"
1313
},
14-
"packageManager": "pnpm@8.10.0",
14+
"packageManager": "pnpm@10.12.3",
1515
"type": "module",
1616
"private": true,
1717
"scripts": {
@@ -22,23 +22,23 @@
2222
"test:unit": "vitest run --passWithNoTests"
2323
},
2424
"dependencies": {
25-
"@lightningjs/renderer": "2.13.2",
25+
"@lightningjs/renderer": "3.0.0-beta9",
2626
"@plextv/react-lightning": "workspace:*",
2727
"@plextv/react-lightning-components": "workspace:*",
28-
"@plextv/react-lightning-plugin-flexbox": "workspace:*",
2928
"@plextv/react-lightning-plugin-css-transform": "workspace:*",
29+
"@plextv/react-lightning-plugin-flexbox": "workspace:*",
3030
"react": "18.3.1",
3131
"react-dom": "18.3.1",
32-
"react-router-dom": "7.1.5",
33-
"swr": "2.3.2"
32+
"react-router-dom": "7.3.0",
33+
"swr": "2.3.3"
3434
},
3535
"devDependencies": {
3636
"@plextv/vite-plugin-msdf-fontgen": "workspace:*",
3737
"@repo/typescript-config": "workspace:*",
3838
"@types/react": "18.3.14",
3939
"@types/react-dom": "18.3.1",
40-
"@vitejs/plugin-react": "4.3.4",
41-
"vite": "6.1.0",
40+
"@vitejs/plugin-legacy": "^7.0.0",
41+
"@vitejs/plugin-react": "4.6.0",
4242
"vite-tsconfig-paths": "5.1.4"
4343
},
4444
"volta": {

apps/react-lightning-example/src/index.tsx

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { SdfTrFontFace } from '@lightningjs/renderer';
22
import {
33
Canvas,
4-
type RenderOptions,
54
createRoot as createRootLng,
5+
type RenderOptions,
66
} from '@plextv/react-lightning';
77
import { plugin as cssTransformPlugin } from '@plextv/react-lightning-plugin-css-transform';
88
import { plugin as flexPlugin } from '@plextv/react-lightning-plugin-flexbox';
99
import { createRoot as createRootDom } from 'react-dom/client';
10-
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
10+
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
1111
import { keyMap } from './keyMap';
1212
import { AnimationPage } from './pages/AnimationPage';
1313
import { BrowsePage } from './pages/BrowsePage';
14-
import { EffectsPage } from './pages/EffectsPage';
1514
import { LayoutPage } from './pages/LayoutPage';
1615
import { Page60 } from './pages/Page60';
1716
import { PosterPage } from './pages/PosterPage';
@@ -20,9 +19,6 @@ import { TexturePage } from './pages/TexturePage';
2019
import { TransformsPage } from './pages/TransformsPage';
2120
import { MyCustomShader } from './shaders/MyCustomShader';
2221
import { MyCustomTexture } from './shaders/MyCustomTexture';
23-
import { NoiseEffect } from './shaders/NoiseEffect';
24-
import { SimpleRadialEffect } from './shaders/SimpleRadialEffect';
25-
import { StaticAlphaEffect } from './shaders/StaticAlphaEffect';
2622

2723
const router = createBrowserRouter([
2824
{
@@ -41,10 +37,6 @@ const router = createBrowserRouter([
4137
path: '/animation',
4238
element: <AnimationPage />,
4339
},
44-
{
45-
path: '/effects',
46-
element: <EffectsPage />,
47-
},
4840
{
4941
path: '/shader',
5042
element: <ShaderPage />,
@@ -82,16 +74,17 @@ const options: RenderOptions = {
8274
stage,
8375
}),
8476
],
85-
enableContextSpy: true,
77+
numImageWorkers: window.navigator.hardwareConcurrency || 2,
8678
plugins: [cssTransformPlugin(), flexPlugin()],
87-
effects: {
88-
Noise: NoiseEffect,
89-
StaticAlpha: StaticAlphaEffect,
90-
SimpleRadial: SimpleRadialEffect,
91-
},
92-
shaders: {
93-
MyCustomShader: MyCustomShader,
94-
},
79+
shaders: [
80+
'Border',
81+
'Shadow',
82+
'Rounded',
83+
'RoundedWithBorder',
84+
'RoundedWithShadow',
85+
'RoundedWithBorderAndShadow',
86+
{ MyCustomShader: MyCustomShader },
87+
],
9588
textures: {
9689
MyCustomTexture: MyCustomTexture,
9790
},

apps/react-lightning-example/src/pages/EffectsPage.tsx

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)