@react-pixi-fiber/react-17 0.0.0-stage → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +30 -2
- package/dist/cjs/react-17.d.ts +17 -0
- package/dist/cjs/react-17.development.js +10704 -0
- package/dist/cjs/react-17.production.min.js +38 -0
- package/dist/cjs/react-17.production.min.js.map +1 -0
- package/dist/es/react-17.d.mts +14 -0
- package/dist/es/react-17.development.js +10707 -0
- package/dist/es/react-17.production.min.js +38 -0
- package/dist/es/react-17.production.min.js.map +1 -0
- package/index.js +11 -0
- package/package.json +59 -3
- package/src/globals.d.ts +2 -0
- package/src/index.ts +174 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @react-pixi-fiber/react-17
|
|
2
|
+
|
|
3
|
+
## 1.0.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- First beta. No new features are planned before the stable release. The API changes only to fix a problem found in use.
|
|
8
|
+
|
|
9
|
+
## 1.0.0-alpha.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [#377](https://github.com/michalochman/react-pixi-fiber/pull/377) [`b5e5be4`](https://github.com/michalochman/react-pixi-fiber/commit/b5e5be46120e80ee101f87775d857a7e190cd633) Thanks [@michalochman](https://github.com/michalochman)! - Initial release. The React 17 adapter for React 17.0.2 or a later 17.x. It bundles `react-reconciler` 0.26.2 and renders on a legacy root, as 2.x did; `react17({ root: "concurrent" })` renders on the experimental concurrent root of React 17 instead.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`446f761`](https://github.com/michalochman/react-pixi-fiber/commit/446f7619b852df4ffdf432d5c032e837f21968ee)]:
|
|
18
|
+
- react-pixi-fiber@3.0.0-alpha.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Michał Ochman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @react-pixi-fiber/react-17
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://npmjs.com/package/@react-pixi-fiber/react-17)
|
|
4
|
+
|
|
5
|
+
React 17 adapter for [react-pixi-fiber](https://github.com/KalambaGames/react-pixi-fiber). It bundles `react-reconciler` 0.26.2 and builds the renderer that `react-pixi-fiber` uses to render PixiJS Display Objects. It needs React 17.0.2 or a later 17.x, the peer range of that `react-reconciler`.
|
|
6
|
+
|
|
7
|
+
Install it next to `react-pixi-fiber`, `react` 17 and a PixiJS adapter from the [adapter table](../react-pixi-fiber/README.md#setup), then configure once in the app entry, before the first render:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import { configure } from "react-pixi-fiber";
|
|
11
|
+
import react17 from "@react-pixi-fiber/react-17";
|
|
12
|
+
import pixiN from "@react-pixi-fiber/pixi-N"; // the PixiJS adapter for your PixiJS version
|
|
13
|
+
|
|
14
|
+
configure({ react: react17(), pixi: pixiN() });
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The tree renders on a legacy root, as 2.x did. To render it on the experimental concurrent root of React 17, as `unstable_createRoot` does, pass `react17({ root: "concurrent" })`.
|
|
18
|
+
|
|
19
|
+
## Supported features
|
|
20
|
+
|
|
21
|
+
The tree inside `Stage`, or inside a container passed to `render`, is its own React root. Features that are plain React work as the [React 17 documentation](https://legacy.reactjs.org/docs/getting-started.html) describes.
|
|
22
|
+
|
|
23
|
+
| Feature | Support |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| Context, error boundaries, hooks, refs | Supported. A ref on a tag receives the PixiJS Display Object |
|
|
26
|
+
| Concurrent features | With `root: "concurrent"`, experimental, as concurrent mode is in React 17: `render` commits synchronously and later updates are scheduled by React. As with `unstable_createRoot`, the whole tree is in strict mode, so React renders each component twice in development. An update from a PixiJS event handler does not get the priority of its DOM event. With the default `root: "legacy"`, not available: the root is a legacy root, as `ReactDOM.render` creates |
|
|
27
|
+
| DevTools | The renderer registers with React DevTools as `react-pixi-fiber` in development |
|
|
28
|
+
| Errors while rendering | Thrown from `render` and caught by error boundaries, as in React 17 |
|
|
29
|
+
| `<StrictMode>` | Development prop validation runs under a `<StrictMode>` ancestor (React 17 mode bit `1`). On a concurrent root the whole tree is in strict mode, so it always runs |
|
|
30
|
+
| `<Suspense>` | Supported. A suspended subtree is hidden with `visible = false` and shown again with its `visible` prop |
|
|
31
|
+
| Text children | Not supported: a string child throws; use the `Text` tag |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HostOps, ReactAdapter } from "react-pixi-fiber";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
declare const strictModeBit = 1;
|
|
4
|
+
interface React17Options {
|
|
5
|
+
/**
|
|
6
|
+
* The kind of root Stage and `render` create: `"legacy"` (the default) commits every update synchronously, as 2.x
|
|
7
|
+
* did; `"concurrent"` is the experimental concurrent mode of React 17.
|
|
8
|
+
*/
|
|
9
|
+
root?: "concurrent" | "legacy";
|
|
10
|
+
}
|
|
11
|
+
declare function createHostConfig(hostOps: HostOps): Record<string, unknown>;
|
|
12
|
+
declare function react17({ root }?: React17Options): ReactAdapter;
|
|
13
|
+
//#endregion
|
|
14
|
+
declare namespace react17 {
|
|
15
|
+
export { React17Options, createHostConfig, react17 as default, strictModeBit };
|
|
16
|
+
}
|
|
17
|
+
export = react17;
|