@flare-engine/engine 0.4.17 → 0.4.19

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.
Files changed (2) hide show
  1. package/README.md +33 -3
  2. package/package.json +19 -19
package/README.md CHANGED
@@ -5,7 +5,7 @@ Convenience integration layer — `createGame(config)` is a pure factory that co
5
5
  The package ships two entry points:
6
6
 
7
7
  - **`.` (default)** — full curated barrel: the 14 headless packages + `@flare-engine/dynamics` + `@flare-engine/postfx` + curated `@flare-engine/react` exports. Pulls in React Native at module scope. `CompiledShader` and `SkImageLike` from postfx are aliased as `PostFxCompiledShader` and `PostFxSkImageLike` to avoid clashing with the render/assets versions. Dynamics' `World` and `Body` are aliased as `DynamicsWorld` and `DynamicsBody` so the ECS `World` keeps the name. React's `GameConfig` is re-exported as `GameViewConfig` to avoid clashing with `createGame`'s own `GameConfig`.
8
- - **`./headless`** — RN-free subset: the 14 headless packages (math, events, core, ecs, render, input, physics, audio, assets, scene, animation, particles, tilemap, debug) plus `createGame` and tier2-wiring. No `@flare-engine/react`, no `@flare-engine/postfx`, no `@flare-engine/dynamics`. Safe for web-only and Node consumers.
8
+ - **`./headless`** — RN-free subset: the 14 headless packages (math, events, core, ecs, render, input, physics, audio, assets, scene, animation, particles, tilemap, debug) plus `createGame` and tier2-wiring. No `@flare-engine/react`, no `@flare-engine/postfx`, no `@flare-engine/dynamics`. It imports no React Native at runtime, but **installing `@flare-engine/engine` still installs React Native**, Skia, Reanimated and Worklets. They are this package's required peers, and its `@flare-engine/react` dependency requires them too. A web or Node project without React Native installs the leaf packages instead ([below](#web-and-node-without-react-native)).
9
9
 
10
10
  `createTier2Wiring` glues optional `AchievementsProvider` / `LeaderboardsProvider` / `AnalyticsProvider` instances to a Tier-2 event source via declarative rules.
11
11
 
@@ -24,7 +24,7 @@ const game = createGame({ fixedDt: 1 / 60 });
24
24
  game.start();
25
25
  ```
26
26
 
27
- ## Usage — headless (web-only / Node / tests)
27
+ ## Usage — headless (tests, or code that must not import React Native)
28
28
 
29
29
  ```ts
30
30
  import { createGame, World, GameLoop } from '@flare-engine/engine/headless';
@@ -33,11 +33,41 @@ const game = createGame({ fixedDt: 1 / 60 });
33
33
  game.start();
34
34
  ```
35
35
 
36
+ ## Web and Node without React Native
37
+
38
+ Install only the leaf packages you use. The 14 that `./headless` re-exports declare no required
39
+ React Native peer (`audio`'s `react-native-audio-api` is optional), so this adds no React Native
40
+ to the tree:
41
+
42
+ ```sh
43
+ bun add @flare-engine/core @flare-engine/ecs @flare-engine/render
44
+ ```
45
+
46
+ ```ts
47
+ import { GameLoop } from '@flare-engine/core';
48
+ import { World } from '@flare-engine/ecs';
49
+
50
+ const world = new World();
51
+ const loop = new GameLoop({ fixedDt: 1 / 60 });
52
+ loop.onUpdate.add((dt) => {
53
+ // run your systems over `world` here; dt is in seconds
54
+ });
55
+ loop.start();
56
+ ```
57
+
58
+ - **Without `createGame`.** `createGame` and `createTier2Wiring` exist only in this package.
59
+ `createGame` just constructs a `World`, `Camera2D`, `Renderer`, `SpriteBatch`, `InputManager`,
60
+ `AudioManager`, `AssetManager`, `SceneManager` and `GameLoop`, so construct the ones you need,
61
+ as above.
62
+ - **In Node.** Node has no `requestAnimationFrame`, so any `GameLoop` (yours or `createGame`'s)
63
+ needs `loop.tick` and `loop.cancelTick` set before `start()`. In tests, `@flare-engine/testing`'s `createTestWorld` steps a loop with a
64
+ fake clock instead.
65
+
36
66
  See [API spec](https://github.com/grzott/flare-engine/blob/main/docs/design/api-specs.md#flare-engineengine).
37
67
 
38
68
  ## React Native New Architecture
39
69
 
40
- Flare's headless packages are architecture-agnostic pure TypeScript. **`@flare-engine/react` requires the New Architecture.** It peers `react-native-reanimated >= 4.0.0` and `react-native-worklets >= 0.7.0`, and Reanimated 4 is New-Architecture-only — so an app using `<GameView>` must run with `newArchEnabled=true`.
70
+ Flare's headless packages are architecture-agnostic pure TypeScript. **`@flare-engine/react` requires the New Architecture.** It peers `react-native-reanimated >= 4.0.0` (`>= 4.1.0` from 0.5.0, since worklets 0.7 needs Reanimated 4.1) and `react-native-worklets >= 0.7.0`, and Reanimated 4 is New-Architecture-only — so an app using `<GameView>` must run with `newArchEnabled=true`.
41
71
 
42
72
  In practice this costs nothing: the New Architecture has been RN's default since 0.76, and every `@flare-engine/create` template pins an Expo SDK whose React Native forces it on.
43
73
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flare-engine/engine",
3
- "version": "0.4.17",
4
- "description": "Flare Engine umbrella — curated barrel (14 headless packages + postfx + react); ./headless subpath for web-only and Node consumers",
3
+ "version": "0.4.19",
4
+ "description": "Flare Engine umbrella — curated barrel (14 headless packages + postfx + react); ./headless subpath imports no React Native, but React Native is a required peer, so web and Node apps install the leaf packages",
5
5
  "keywords": [
6
6
  "flare-engine",
7
7
  "2d",
@@ -57,23 +57,23 @@
57
57
  "typecheck": "tsc --noEmit"
58
58
  },
59
59
  "dependencies": {
60
- "@flare-engine/math": "^0.4.17",
61
- "@flare-engine/events": "^0.4.17",
62
- "@flare-engine/core": "^0.4.17",
63
- "@flare-engine/dynamics": "^0.4.17",
64
- "@flare-engine/ecs": "^0.4.17",
65
- "@flare-engine/render": "^0.4.17",
66
- "@flare-engine/input": "^0.4.17",
67
- "@flare-engine/physics": "^0.4.17",
68
- "@flare-engine/audio": "^0.4.17",
69
- "@flare-engine/assets": "^0.4.17",
70
- "@flare-engine/scene": "^0.4.17",
71
- "@flare-engine/animation": "^0.4.17",
72
- "@flare-engine/particles": "^0.4.17",
73
- "@flare-engine/tilemap": "^0.4.17",
74
- "@flare-engine/debug": "^0.4.17",
75
- "@flare-engine/postfx": "^0.4.17",
76
- "@flare-engine/react": "^0.4.17"
60
+ "@flare-engine/math": "^0.4.19",
61
+ "@flare-engine/events": "^0.4.19",
62
+ "@flare-engine/core": "^0.4.19",
63
+ "@flare-engine/dynamics": "^0.4.19",
64
+ "@flare-engine/ecs": "^0.4.19",
65
+ "@flare-engine/render": "^0.4.19",
66
+ "@flare-engine/input": "^0.4.19",
67
+ "@flare-engine/physics": "^0.4.19",
68
+ "@flare-engine/audio": "^0.4.19",
69
+ "@flare-engine/assets": "^0.4.19",
70
+ "@flare-engine/scene": "^0.4.19",
71
+ "@flare-engine/animation": "^0.4.19",
72
+ "@flare-engine/particles": "^0.4.19",
73
+ "@flare-engine/tilemap": "^0.4.19",
74
+ "@flare-engine/debug": "^0.4.19",
75
+ "@flare-engine/postfx": "^0.4.19",
76
+ "@flare-engine/react": "^0.4.19"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "react": ">=19.0.0",