Skip to content

Commit 88c8905

Browse files
authored
Merge pull request #573 from pixijs/v8-release
v8 Pre-Release Changes
2 parents a24be76 + 1d698f8 commit 88c8905

File tree

7 files changed

+3
-60
lines changed

7 files changed

+3
-60
lines changed

src/components/Application.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const ApplicationImplementation = forwardRef<ApplicationRef, ApplicationProps>(f
137137

138138
if (!root)
139139
{
140-
root = createRoot(canvasElement, {}, handleInit);
140+
root = createRoot(canvasElement, { onInit: handleInit });
141141
}
142142

143143
// @ts-expect-error The value of `children` is fine, but `PixiReactChildNode` doesn't strictly adhere to the `ReactNode` structure.

src/core/createRoot.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ export function createRoot(
2020

2121
/** @description Options to configure the tree. */
2222
options: CreateRootOptions = {},
23-
24-
/**
25-
* @deprecated
26-
* @description Callback to be fired when the application finishes initializing.
27-
*/
28-
onInit?: (app: Application) => void,
2923
)
3024
{
3125
// Check against mistaken use of createRoot
@@ -93,7 +87,7 @@ export function createRoot(
9387
applicationState.isInitialising = false;
9488
applicationState.isInitialised = true;
9589
applicationState = { ...applicationState };
96-
(options.onInit ?? onInit)?.(applicationState.app);
90+
options.onInit?.(applicationState.app);
9791
}
9892

9993
Object.entries(applicationOptions).forEach(([key, value]) =>

src/hooks/useApp.ts

-22
This file was deleted.

src/hooks/useTick.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
88
export function useTick<T>(
99
/** @description The function to be called on each tick. */
1010
options: TickerCallback<T> | UseTickOptions<T>,
11-
12-
/**
13-
* @deprecated
14-
* @description Whether this callback is currently enabled.
15-
*/
16-
enabled = true,
1711
)
1812
{
1913
const {
@@ -25,7 +19,7 @@ export function useTick<T>(
2519

2620
let context: any;
2721

28-
let isEnabled = enabled;
22+
let isEnabled: boolean = true;
2923

3024
let priority: number | undefined;
3125

@@ -69,7 +63,6 @@ export function useTick<T>(
6963
}, [
7064
callback,
7165
context,
72-
isEnabled,
7366
isInitialised,
7467
priority,
7568
]);

src/index.ts

-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
console.warn(`
2-
Be aware that you are using a beta version of Pixi React.
3-
- Things may be broken.
4-
- Things may (but shouldn't) change.
5-
- All functionality that's deprecated in the beta version WILL BE REMOVED for the production release.
6-
`);
7-
81
export { Application } from './components/Application';
92
export { createRoot } from './core/createRoot';
103
export * from './global';
114
export { extend } from './helpers/extend';
12-
export { useApp } from './hooks/useApp';
135
export { useApplication } from './hooks/useApplication';
146
export { useExtend } from './hooks/useExtend';
157
export { useTick } from './hooks/useTick';

src/typedefs/ApplicationProps.ts

-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ import { type PixiReactChildNode } from './PixiReactChildNode';
1313

1414
export interface BaseApplicationProps
1515
{
16-
/**
17-
* @description Whether this application chould be attached to the dev tools. NOTE: This should only be enabled on one application at a time.
18-
* @deprecated Pixi.js handles this automatically, making this option superfluous.
19-
*/
20-
attachToDevTools?: boolean
21-
2216
/** @description CSS classes to be applied to the Pixi Application's canvas element. */
2317
className?: string
2418

test/unit/index.test.ts

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
import { Application } from '../../src/components/Application';
77
import { createRoot } from '../../src/core/createRoot';
88
import { extend } from '../../src/helpers/extend';
9-
import { useApp } from '../../src/hooks/useApp';
109
import { useApplication } from '../../src/hooks/useApplication';
1110
import { useExtend } from '../../src/hooks/useExtend';
1211
import { useTick } from '../../src/hooks/useTick';
@@ -32,12 +31,6 @@ describe('exports', () =>
3231
expect(PixiReact.extend).toEqual(extend);
3332
});
3433

35-
it('exports the `useApp()` hook', () =>
36-
{
37-
expect(PixiReact).toHaveProperty('useApp');
38-
expect(PixiReact.useApp).toEqual(useApp);
39-
});
40-
4134
it('exports the `useApplication()` hook', () =>
4235
{
4336
expect(PixiReact).toHaveProperty('useApplication');
@@ -61,7 +54,6 @@ describe('exports', () =>
6154
expect(PixiReact).toHaveProperty('Application');
6255
expect(PixiReact).toHaveProperty('createRoot');
6356
expect(PixiReact).toHaveProperty('extend');
64-
expect(PixiReact).toHaveProperty('useApp');
6557
expect(PixiReact).toHaveProperty('useApplication');
6658
expect(PixiReact).toHaveProperty('useExtend');
6759
expect(PixiReact).toHaveProperty('useTick');

0 commit comments

Comments
 (0)