Repository navigation
Releases: KalambaGames/react-pixi-fiber
Release list
react-pixi-fiber@3.0.0-alpha.1
Patch Changes
-
#387
8ab7e10Thanks @michalochman! - TheStageerror for a rejectedappprop names the two forms thatStageaccepts: aPIXI.Application, or an object that the PixiJS adapter accepts as one. The pixi-8 adapter accepts an object with aContainerasstage.usePixiTickerthrows during render when theapphas noticker, and the error names theticker.
@react-pixi-fiber/pixi-8@1.0.0-alpha.1
Minor Changes
-
#387
7a6bea7Thanks @michalochman! -pixi8WithComponentstakes the PixiJS classes that the app renders ascomponents. A bundle of the ES build holds only those classes.pixi8()keeps every class:import { Application, Container, Sprite, Text } from "pixi.js"; import { pixi8WithComponents } from "@react-pixi-fiber/pixi-8"; configure({ react: react18(), pixi: pixi8WithComponents({ components: { Application, Container, Sprite, Text } }) });
A tag left out of the list throws at first render, and the error names the class to add.
ParticleContainerneedsParticlein the list. WithoutApplicationin the list,Stageneeds anappprop. Thatappneeds aContainerasstage, and atickerforusePixiTicker. So an app can make its own renderer.allComponentsholds every class thatpixi8()uses.
2.0.0
Same code as 2.0.0-rc.4. Changes since 1.0.6, collected from the 2.0.0 prereleases:
Same code as 2.0.0-rc.4. Changes since 1.0.6, collected from the prereleases below:
Changed
- Requires React 18.2 or newer,
react-reconcilerupdated to 0.29 refon built-in and custom components is now typed as the underlyingPIXI.DisplayObjectinstance instead of the props type- Every component accepts
childrenagain in TypeScript, as every wrapped display object is aPIXI.Container - Declared
pixi.jspeer dependency as>=4.4.0 <8.0.0, PixiJS v8 is not supported
Removed
- Removed unstable_batchedUpdates API ([#89])
Added
- TypeScript:
CustomPIXIPropertyis now declared inindex.d.ts - TypeScript:
PointLikeTupleaccepts a single element tuple (e.g.scale={[2]}), matching runtime behavior - TypeScript:
this.applyDisplayObjectPropsinsidecustomApplyPropsis now typed (CustomDisplayObjectPropSetterContext), along withCustomPIXIComponentPropshelper type - Examples are now written in TypeScript and typechecked against the local
index.d.tsin CI
Fixed
Stagerenders a new canvas whenPIXI.Applicationis recreated after non-dimensionaloptionschange. Previously the newPIXI.Applicationshared the canvas with the one being destroyed, and destroying it unbound the current WebGL program (PixiJS v6) or lost the context (PixiJS v7), leaving only the background color rendered- Create React App 5 (and other webpack builds with strict export checks) failed with "Attempted import error: 'extras' is not exported from 'pixi.js'" when using PixiJS v5+. The ES build read the PixiJS v4
extras,meshandparticlesnamespaces straight from thepixi.jsimport, the fallback to the top-level classes is unchanged - TypeScript:
Textaccepts a plain style object instyle(Partial<PIXI.ITextStyle>), matching thePIXI.Textsetter. PixiJS v7 types thestylegetter asTextStyleonly, so passing an object literal failed to typecheck
react-pixi-fiber@3.0.0-alpha.0
Major Changes
-
#377
446f761Thanks @michalochman! - Split into a core package and per-version adapters. Callconfigure({ react, pixi })once at the app entry with a React adapter (@react-pixi-fiber/react-17,react-18,react-19) and a PixiJS adapter (@react-pixi-fiber/pixi-4topixi-8). See the migration guide in the README.Added
configure({ react, pixi }), called once in the app entry before the first render, wires a React adapter and a PixiJS adapter into the core. Without it the first render throws an error that prints the install line and the setup lines- React adapters:
@react-pixi-fiber/react-17for React 17.0.2 or a later 17.x,@react-pixi-fiber/react-18for React 18.3.1 or a later 18.x and@react-pixi-fiber/react-19for React 19.3 or a later 19.x - PixiJS adapters:
@react-pixi-fiber/pixi-4for PixiJS 4.4 or a later 4.x,@react-pixi-fiber/pixi-5,@react-pixi-fiber/pixi-6,@react-pixi-fiber/pixi-7for PixiJS 7.2 or a later 7.x and@react-pixi-fiber/pixi-8for PixiJS 8.9 or a later 8.x. Thepixi-7andpixi-8adapters have acompat/pixi6module that translates the 2.x props their PixiJS version renamed or ignores. Each adapter's changelog lists its tags and peers - Fragment refs on React 19: a
<Fragment ref>insideStagereceives aPixiFragmentInstancewithchildren,getBounds(),off(event, fn)andon(event, fn)over the fragment's top-level display objects - The PixiJS adapter's
defaultsoption sets default props per tag, like React'sdefaultProps:pixi6({ defaults: { Sprite: { alpha: 0.5 } } }). A prop that is missing orundefinedwhen the instance is created gets its default beforecreateruns, and a prop removed later, or set toundefined, returns to it. An explicitnullis kept. Entries are keyed by the tag name; the deprecatedNineSlicePlaneon PixiJS 8 is keyed asNineSliceSprite - A PixiJS adapter can rename props with
translatePropsbefore they are validated, set or diffed; aPIXIComponentwith its ownapplyPropsreceives the props as written, with thedefaultsapplied PIXIComponent(type, behavior)andPIXIPropertyreplaceCustomPIXIComponent(behavior, type)andCustomPIXIProperty. Behavior keys arecreate,applyProps,afterAdd,beforeRemove, and the unstableappendChild,insertBeforeandremoveChild, which let a container own the order of children that are not display objects. TheBehavior,BehaviorInputandApplyPropsContexttypes describe a behaviorgetInstanceTag(instance)returns the tag an instance was created with, after a deprecated tag is mapped- A tag registered with
PIXIComponentunder the name of an adapter tag replaces the adapter tag and warns once in development. 2.x always created the built-in tag PIXIPropertyaccepts tags registered withPIXIComponent; 2.x reported them as not a valid component typePixiTickerCallbacktype export, the callback typeusePixiTickertakes- Tags
AnimatedSprite,Mesh,MeshSimple,MeshPlane,MeshRopeandNineSliceSprite. Every PixiJS adapter implements all 13 tags StageonInit(app)prop, called once the PixiJS application exists and the children are renderedStagebridgeContextsprop, a list of React contexts provided aroundStagethat its children can read. React does not pass context between renderers;Stagereads each context where it renders and provides it again inside, and renders the children again when a value changes
Changed
react-reconcilermoved from the core into the React adapters;@react-pixi-fiber/react-17bundlesreact-reconciler0.26.2,@react-pixi-fiber/react-180.29.2 and@react-pixi-fiber/react-190.34.0pixi.jsis no longer a peer dependency of the core, the PixiJS adapter has it. The core'sreactpeer is>=17.0.0 <20.0.0- PixiJS 7.0–7.1 and 8.0–8.8 are not supported:
@react-pixi-fiber/pixi-7peerspixi.js^7.2.0 (eventModefirst ships in 7.2) and@react-pixi-fiber/pixi-8peerspixi.js^8.9.0 (the first 8.x with every tag it exports). 2.x peeredpixi.js>=4.4.0 <8 - A second
configurecall after a render warns once in development. Trees already rendered keep their React renderer; new PixiJS instances and prop writes use the new adapter - The types
InteractionCompatibility,InteractionEventCompatibilityandPixiTypeFallbackimport from the PixiJS adapter:@react-pixi-fiber/pixi-4,pixi-5andpixi-6export all three,@react-pixi-fiber/pixi-7exportsPixiTypeFallback - Build output moved from
cjs/andes/todist/cjs/anddist/es/. Imports ofreact-pixi-fiberare unaffected; direct paths to the built files need thedist/prefix - The
usePixiTickercallback has the typeapp.ticker.addtakes on the configured PixiJS version - Examples are built with Vite instead of Create React App
- Examples run on PixiJS 7 with
@pixi/layersinstead of PixiJS 6 package.jsonhas anexportsmap. Bundlers that understand it (webpack 5, Vite) get the ES build directly, the development or production file picked by thedevelopmentcondition; Node andrequirestill get the CommonJS entry points. Onlyreact-pixi-fiberandreact-pixi-fiber/package.jsoncan be imported, deep imports intodist/orsrc/no longer resolve- The
moduleandjsnext:mainfields andindex.es.jsare removed.index.es.jswas a CommonJS wrapper around the ES build; bundlers that ignoreexportsnow usemain - The type declarations are regular modules for the CommonJS and the ES build instead of a
declare module "react-pixi-fiber"block.tsconfig.jsonpathspointingreact-pixi-fiberatindex.d.tsare no longer needed - Code is formatted and linted with Biome instead of Prettier and ESLint
- The library is built with tsdown instead of Rollup 2 and Babel. The code targets ES2018 instead of ES5 and is minified with Oxc instead of terser; for the same source the development builds are about 20% and the production builds about 3% smaller
- The library tests run with Vitest instead of Jest 26;
pnpm teststill runs the development and production suites. Babel and babel-plugin-rewire are gone, the tests mock modules withvi.mockinstead Stagecreates the PixiJS application asynchronously. Children mount afterStagecommits;ref._app.currentisnulluntilonInitfires and warns in development when read before thatStagecallsonInitonce for every application it creates or is given inappand keeps, so again after anoptionschange recreates the application. Anoptionschange while the application is being created is applied once it exists. A failed application creation (a thrown error or a rejected promise) reaches the nearest error boundary. UnmountingStagebefore the application exists destroys the application when it is ready and never callsonInit- Destroying the application of an unmounted or recreated
Stagekeeps the WebGL context of a canvas still in the document, such as an externaloptions.view, so the next application on that canvas can draw; 2.x lost it. The next application is created once the previous one is destroyed. The development double mount under<StrictMode>no longer leaves the canvas blank Stagewarns once in development when itsappprop changes after mount; it keeps the application it started withStagerenders no<canvas>whenoptions.canvasis set, as foroptions.view. On PixiJS 8 the application draws on the given canvas; when both are given,viewwins. On PixiJS 4 to 7canvasis not an application option, andStagewarns once in developmentStagehas nodefaultProps:ref.current.props.optionsisundefinedwhenoptionsis omitted (it was{})Stagepasses typed prop names and Container prop names (for examplebuttonMode,interactiveChildren) toapp.stage. 2.x compared the names in lowercase, so these props went to the<canvas>element- A prop set to
undefinedis reset to the value PixiJS had before the first write, recorded per instance, instead of a value from a table. This covers every PixiJS version and custom components. For exampleTexttextset toundefinedgoes back to the value thePIXI.Textwas created with, not"" - Removing a prop restores the value the instance had before react-pixi-fiber first set it, which may be
undefinedon PixiJS 8 (mask,filters), instead of setting numeric and untyped props tonull, so<Sprite alpha={0.5} />re-rendered as<Sprite />hasalpha1 again. An explicitnullis still set as-is on numeric, boolean and untyped props; on point and callback props it is an invalid value, as in 2.x. A prop set toundefinedor removed no longer warns under<StrictMode>; the development warning for an invalid value names the received value ("Received-1for propalpha…") instead of "Received undefined" - Development prop validation now runs on React 18 and 19 for components under a
<StrictMode>placed insideStage(or inside the tree passed torender). It never ran on React 18 or 19 before, because the library checked React 17's mode bit. A<StrictMode>around<Stage>does not reach the PixiJS tree, which is a separate React root, as in 2.x - A boolean or function value on a prop the library does not type is set on the instance instead of being dropped (
<Container sortableChildren />works on PixiJS 4 to 7). Unknown prop names are no longer reported in development; they are set as-is. The development warning for an event handler prop checks onlyonplus an uppercase letter, soonclickno longer warns - `apply...
@react-pixi-fiber/react-19@1.0.0-alpha.0
Major Changes
- #377
b5e5be4Thanks @michalochman! - Initial release. The React 19 adapter for React 19.3 or a later 19.x. It bundlesreact-reconciler0.34.0 and renders on a concurrent root, ascreateRootdoes; 2.x rendered on a legacy root. It logs uncaught, caught and recoverable render errors withconsole.error, gives a<Fragment ref>insideStageaPixiFragmentInstance, and renders a<ViewTransition>insideStagewithout animating.
Patch Changes
- Updated dependencies [
446f761]:- react-pixi-fiber@3.0.0-alpha.0
@react-pixi-fiber/react-18@1.0.0-alpha.0
Major Changes
- #377
b5e5be4Thanks @michalochman! - Initial release. The React 18 adapter for React 18.3.1 or a later 18.x; 2.x accepted React 18.2. It bundlesreact-reconciler0.29.2 and renders on a legacy root, as 2.x did;react18({ root: "concurrent" })renders on a concurrent root instead. Errors React recovers from are logged withconsole.error.
Patch Changes
- Updated dependencies [
446f761]:- react-pixi-fiber@3.0.0-alpha.0
@react-pixi-fiber/react-17@1.0.0-alpha.0
Major Changes
- #377
b5e5be4Thanks @michalochman! - Initial release. The React 17 adapter for React 17.0.2 or a later 17.x. It bundlesreact-reconciler0.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.
Patch Changes
- Updated dependencies [
446f761]:- react-pixi-fiber@3.0.0-alpha.0
@react-pixi-fiber/pixi-8@1.0.0-alpha.0
Major Changes
-
#377
b5e5be4Thanks @michalochman! - Initial release. The PixiJS 8 adapter for PixiJS 8.9 or a later 8.x, the first with every tag it exports. It implements the 13 core tags andDOMContainer,HTMLText,Particle,PerspectiveMesh,RenderContainerandRenderLayer.NineSlicePlanemaps toNineSliceSpriteand warns once in development.Graphicspassescontextto the constructor.ParticleContainertakesParticlechildren; a Suspense boundary inside it does not hide its particles, and it cannot be the container passed torender.RenderLayerdraws the objects attached to it withattach; its JSX children draw in tree order.Stageputs the untypedContainerprops of PixiJS 8, such asboundsArea,cullArea,labelandtint, onapp.stage, not on the<canvas>.The default export of
@react-pixi-fiber/pixi-8/compat/pixi6(also served ascompat/pixi7), passed aspixi8({ compat }), translates the PixiJS 6 and 7 props PixiJS 8 renamed or deprecated: the event names become theonhandler properties (clicktoonclick),mousemove,pointermoveandtouchmovebecomeonglobalmousemove,onglobalpointermoveandonglobaltouchmove,buttonModebecomescursor,interactivebecomeseventMode("static"or"passive", as PixiJS 8's setter does),namebecomeslabelanduvRespectAnchorbecomesapplyAnchorToTexture. Each translated prop warns once in development; when the PixiJS 8 prop is also set, it wins and a warning names both. Without the import the adapter holds no compat code.
Patch Changes
- Updated dependencies [
446f761]:- react-pixi-fiber@3.0.0-alpha.0
@react-pixi-fiber/pixi-7@1.0.0-alpha.0
Major Changes
-
#377
b5e5be4Thanks @michalochman! - Initial release. The PixiJS 7 adapter for PixiJS 7.2 or a later 7.x, the first witheventMode. It implements the 13 core tags andHTMLText, and keepsNineSlicePlane,SimpleMesh,SimplePlaneandSimpleRopeas tags forNineSliceSprite,MeshSimple,MeshPlaneandMeshRope.Graphicspassesgeometryto the constructor. It exports thePixiTypeFallbacktype.The default export of
@react-pixi-fiber/pixi-7/compat/pixi6, passed aspixi7({ compat }), translates the PixiJS 6 props: the event names become theonhandler properties (clicktoonclick),mousemove,pointermoveandtouchmovebecomeonglobalmousemove,onglobalpointermoveandonglobaltouchmove,buttonModebecomescursor("pointer"ornull) andinteractivebecomeseventMode("static"or"auto", as PixiJS 7's deprecated setter does). Each translated prop warns once in development; when the PixiJS 7 prop is also set, it wins and a warning names both. Withoutcompat, the event names andbuttonMode, which PixiJS 7 ignores, warn once per prop name in development.
Patch Changes
- Updated dependencies [
446f761]:- react-pixi-fiber@3.0.0-alpha.0
@react-pixi-fiber/pixi-6@1.0.0-alpha.0
Major Changes
- #377
b5e5be4Thanks @michalochman! - Initial release. The PixiJS 6 adapter for PixiJS 6.x. It implements the 13 core tags and keepsNineSlicePlane,SimpleMesh,SimplePlaneandSimpleRopeas tags forNineSliceSprite,MeshSimple,MeshPlaneandMeshRope.Graphicspassesgeometryto the constructor. It exports theInteractionCompatibility,InteractionEventCompatibility,InteractiveComponentandPixiTypeFallbacktypes.
Patch Changes
- Updated dependencies [
446f761]:- react-pixi-fiber@3.0.0-alpha.0