Skip to content

Commit 741fa33

Browse files
chiefcllthetarnav
andauthored
Rc3 (#26)
* get it working with RendererV3 * add solid dev tools * Add KeepAlive demo (#11) * Add KeepAlive demo * Cleanup KeepAlive * Rename to createPersistentComponent, add tsdoc, add detachedOwner * Update KeepAlive documentation * Cleanup createPersistentComponent * update to latest deps * Use lightning/solid as jsxImportSource (#13) Also adds @lightningtv/source customCondition and removes @lightningjs/solid import path (it's unused afaik) * solid-devtools support (#9) * Pass lightning element interface to solid devtools * Update lockfile * Limit vite-hex-transform to src and add more solid devtools plugin options * Use setElementInterface * Update solid-devtools * Add Suspense page and custom suspense component (#16) * Add Suspense page * Implement custom suspense * Add jsdoc to Suspense and handle case when children are falsy * Remove unnecessary types.ts file (sync with main) (#19) * get working with latest beta-14 of renderer * get working with latest beta * fully working with beta renderer * final touches on rc3 --------- Co-authored-by: Damian Tarnawski <gthetarnav@gmail.com>
1 parent 5ce72cf commit 741fa33

12 files changed

Lines changed: 69 additions & 95 deletions

File tree

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build:github:dev": "NODE_ENV=development vite build --sourcemap=true --mode development --base=/solid-demo-app/",
1616
"build:analyze": "vite-bundle-visualizer",
1717
"deploy": "gh-pages -d dist",
18-
"preview": "vite preview --port 8080",
18+
"preview": "vite preview --port 8080 --host",
1919
"tsc": "tsc",
2020
"lint:prettier": "prettier --check \"**/*.{ts,js,cjs,md,tsx}\"",
2121
"lint:fix:prettier": "prettier --write \"**/*.{ts,js,cjs,md,tsx}\"",
@@ -24,10 +24,9 @@
2424
"author": "",
2525
"license": "ISC",
2626
"dependencies": {
27+
"@lightningjs/renderer": "3.0.0-beta19",
28+
"@lightningtv/solid": "3.0.0-23",
2729
"@firebolt-js/sdk": "^1.7.0",
28-
"@lightningjs/renderer": "2.20.0",
29-
"@lightningtv/core": "2.14.0",
30-
"@lightningtv/solid": "^2.12.5",
3130
"@solid-primitives/list": "^0.1.2",
3231
"@solid-primitives/scheduled": "^1.5.2",
3332
"@solidjs/router": "^0.15.3",
@@ -63,5 +62,5 @@
6362
],
6463
"*.{js,cjs,md}": "prettier --write"
6564
},
66-
"packageManager": "pnpm@10.8.0"
65+
"packageManager": "pnpm@10.17.0"
6766
}

pnpm-lock.yaml

Lines changed: 17 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Icon.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ function Icon(props: IconProps) {
2323
<View
2424
{...props}
2525
texture={sprite[props.name]}
26-
width={sprite[props.name].props.width}
27-
height={sprite[props.name].props.height}
28-
x={(100 - (sprite[props.name].props.width || 0)) / 2}
29-
y={(100 - (sprite[props.name].props.height || 0)) / 2}
26+
width={sprite[props.name].props.w}
27+
height={sprite[props.name].props.h}
28+
x={(100 - (sprite[props.name].props.w || 0)) / 2}
29+
y={(100 - (sprite[props.name].props.h || 0)) / 2}
3030
></View>
3131
);
3232
}

src/components/NavDrawer/NavDrawer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export default function NavDrawer(props) {
7575
return (
7676
<>
7777
<View
78+
id="NavDrawer"
7879
flexItem={false}
7980
width={300}
8081
height={150}

src/components/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export function FocusRing(props: IntrinsicNodeProps) {
3131
export interface TileRowProps extends IntrinsicNodeProps {
3232
items: Tile[];
3333
title?: string;
34+
rowType?: string;
35+
gap?: number;
36+
scroll?: string;
3437
}
3538

3639
export function TileRow(props: TileRowProps) {

src/fonts.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,29 @@ export default [
66
{
77
type: "msdf",
88
fontFamily: "Roboto",
9-
descriptors: {
10-
weight: 700
11-
},
12-
atlasDataUrl: basePath + "fonts/Roboto-Bold.msdf.json",
13-
atlasUrl: basePath + "fonts/Roboto-Bold.msdf.png"
9+
atlasDataUrl: basePath + "fonts/Roboto-Regular.msdf.json",
10+
atlasUrl: basePath + "fonts/Roboto-Regular.msdf.png"
1411
} as const,
1512
{
1613
type: "msdf",
17-
fontFamily: "Roboto",
18-
descriptors: {
19-
weight: 400
20-
},
21-
atlasDataUrl: basePath + "fonts/Roboto-Regular.msdf.json",
22-
atlasUrl: basePath + "fonts/Roboto-Regular.msdf.png"
14+
fontFamily: "Roboto700",
15+
atlasDataUrl: basePath + "fonts/Roboto-Bold.msdf.json",
16+
atlasUrl: basePath + "fonts/Roboto-Bold.msdf.png"
2317
} as const,
2418
{
2519
type: "msdf",
2620
fontFamily: "Arial",
27-
descriptors: {
28-
weight: 500
29-
},
3021
atlasDataUrl: basePath + "fonts/Roboto-Regular.msdf.json",
3122
atlasUrl: basePath + "fonts/Roboto-Regular.msdf.png"
3223
} as const,
3324
{
3425
type: "msdf",
3526
fontFamily: "Raleway",
36-
descriptors: {
37-
weight: 800
38-
},
3927
atlasDataUrl: basePath + "fonts/Raleway-ExtraBold.msdf.json",
4028
atlasUrl: basePath + "fonts/Raleway-ExtraBold.msdf.png"
4129
} as const,
4230
{
43-
fontFamily: "Roboto",
31+
fontFamily: "Roboto400",
4432
fontUrl: basePath + "fonts/Roboto-Regular.ttf"
4533
} as WebTrFontFaceOptions
4634
];

src/index.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Config.rendererOptions = {
107107
deviceLogicalPixelRatio,
108108
devicePhysicalPixelRatio: 1,
109109
createImageBitmapSupport: "auto",
110-
targetFPS: 60,
110+
targetFPS: 0,
111111
//boundsMargin: 200,
112112
};
113113

@@ -123,23 +123,23 @@ if (rendererMode === "canvas") {
123123
const { renderer, render } = createRenderer();
124124
loadFonts(fonts);
125125
// Prepare for RC3 of Renderer
126-
// import {
127-
// Rounded,
128-
// RoundedWithBorder,
129-
// RoundedWithShadow,
130-
// RoundedWithBorderAndShadow,
131-
// RadialGradient,
132-
// LinearGradient,
133-
// HolePunch,
134-
// } from '@lightningjs/renderer/webgl/shaders';
135-
// const shManager = renderer.stage.shManager;
136-
// shManager.registerShaderType('rounded', Rounded)
137-
// shManager.registerShaderType('roundedWithBorder', RoundedWithBorder)
138-
// shManager.registerShaderType('roundedWithShadow', RoundedWithShadow)
139-
// shManager.registerShaderType('roundedWithBorderWithShadow', RoundedWithBorderAndShadow)
140-
// shManager.registerShaderType('radialGradient', RadialGradient)
141-
// shManager.registerShaderType('linearGradient', LinearGradient)
142-
// shManager.registerShaderType('holePunch', HolePunch)
126+
import {
127+
Rounded,
128+
RoundedWithShadow,
129+
RoundedWithBorderAndShadow,
130+
RadialGradient,
131+
LinearGradient,
132+
HolePunch,
133+
} from '@lightningjs/renderer/webgl/shaders';
134+
import { RoundedWithBorder } from '@lightningtv/solid/shaders';
135+
const shManager = renderer.stage.shManager;
136+
shManager.registerShaderType('rounded', Rounded)
137+
shManager.registerShaderType('roundedWithBorder', RoundedWithBorder)
138+
shManager.registerShaderType('roundedWithShadow', RoundedWithShadow)
139+
shManager.registerShaderType('roundedWithBorderWithShadow', RoundedWithBorderAndShadow)
140+
shManager.registerShaderType('radialGradient', RadialGradient)
141+
shManager.registerShaderType('linearGradient', LinearGradient)
142+
shManager.registerShaderType('holePunch', HolePunch)
143143
render(() => (
144144
<FocusStackProvider>
145145
<HashRouter root={(props) => <App {...props} />}>

src/pages/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
useFocusManager,
33
useMouse,
44
} from "@lightningtv/solid/primitives";
5-
import { KeyMap, KeyHoldMap } from "@lightningtv/core/focusManager";
5+
import { KeyMap, KeyHoldMap } from "@lightningtv/solid/focusManager";
66

77
const App = (props) => {
88
useFocusManager(

src/pages/LeftNavWrapper.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const LeftNavWrapper = (props) => {
5858
setShowWidgets(matchesPartial);
5959
});
6060

61-
const [lastKey, setLastKey] = createSignal<string | undefined>();
61+
const [lastKey, setLastKey] = createSignal<string>('Last key: undefined');
6262
const [lastError, setLastError] = createSignal<string | undefined>();
6363
const keyPressHandler = (e) => {
6464
setLastKey(`Last key: ${e.key}, Code: ${e.keyCode}`);
@@ -68,6 +68,8 @@ const LeftNavWrapper = (props) => {
6868
setLastError((p) => (p || "") + "\n" + e.message);
6969
};
7070
document.addEventListener("onerror", displayError);
71+
const windowSize = `${window.innerWidth}x${window.innerHeight}`;
72+
7173
onCleanup(() => {
7274
document.removeEventListener("onerror", displayError);
7375
document.removeEventListener("keydown", keyPressHandler);
@@ -91,17 +93,22 @@ const LeftNavWrapper = (props) => {
9193
}
9294
>
9395
<Background />
94-
<FPSCounter mountX={1} x={1910} y={10} alpha={showWidgets() ? 1 : 0} />
96+
<FPSCounter mountX={1} x={1910} y={10} alpha={1} />
9597
<View
9698
mountX={1}
99+
display="flex"
100+
flexDirection="column"
97101
width={330}
98-
height={28}
102+
height={50}
99103
x={1910}
100-
y={190}
104+
y={202}
101105
color={0x000000ff}
102106
hidden={!showWidgets()}
103107
>
104-
<Text fontSize={20} y={4} x={4}>
108+
<Text x={8} fontSize={15}>
109+
Window Size: {windowSize}
110+
</Text>
111+
<Text x={8} fontSize={15}>
105112
{lastKey()}
106113
</Text>
107114
</View>

src/pages/Portal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const Portal = (props) => {
8888
y={140}
8989
fontSize={42}
9090
width={340}
91-
height={42}
91+
maxHeight={42}
9292
contain="both"
9393
color={hasFocus() ? 0x000000ff : 0xffffffff}
9494
>

0 commit comments

Comments
 (0)