Skip to content

Commit b472e28

Browse files
committed
v2.5.0 - 2022-11-03
1 parent 8c96831 commit b472e28

File tree

17 files changed

+390
-544
lines changed

17 files changed

+390
-544
lines changed

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
99

1010
jobs:
1111
release:
12+
if: github.repository_owner == 'pmndrs'
1213
name: Release
1314
runs-on: ubuntu-latest
1415
steps:

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# @pmndrs/use-cannon Changelog
22

3+
## v2.5.0 - 2022-11-03
4+
5+
- [@pmndrs/cannon-worker-api] v2.3.0
6+
- [@react-three/cannon] v6.5.0
7+
- [@react-three/cannon-examples] v2.4.0
8+
- Setup changesets & publish workflow (@isaac-mason)
9+
- Do not attempt to publish on forks (@bjornstar)
10+
311
## v2.4.0 - 2022-08-18
412

5-
- [@pmndrs/cannon-worker-api] v2.1.0
13+
- [@pmndrs/cannon-worker-api] v2.2.0
614
- [@react-three/cannon] v6.4.0
715

816
## v2.3.0 - 2022-04-18

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pmndrs/use-cannon",
3-
"version": "0.0.1",
3+
"version": "2.5.0",
44
"private": true,
55
"description": "monorepo for @pmndrs/use-cannon",
66
"keywords": [
@@ -24,7 +24,7 @@
2424
"lint-staged": "^12.1.2"
2525
},
2626
"engines": {
27-
"node": ">=14",
27+
"node": ">=16",
2828
"npm": ">=8"
2929
},
3030
"lint-staged": {

packages/cannon-worker-api/CHANGELOG.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# @pmndrs/cannon-worker-api Changelog
22

3-
## 2.2.1
3+
## v2.3.0 - 2022-11-03
44

5-
### Patch Changes
6-
7-
- e0d4113: remove subscriptions when removing bodies and vehicles (@alex-shortt)
5+
- Remove subscriptions when removing bodies and vehicles (@alex-shortt)
86

97
## v2.2.0 - 2022-08-18
108

packages/cannon-worker-api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pmndrs/cannon-worker-api",
3-
"version": "2.2.1",
3+
"version": "2.3.0",
44
"description": "An API to use cannon-es in a web worker",
55
"keywords": [
66
"cannon",

packages/react-three-cannon-examples/CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# @react-three/cannon-examples Changelog
22

3+
## v2.4.0 - 2022-11-03
4+
5+
- Remove some types & an expect-error that are no longer necessary (@bjornstar)
6+
- Inline the only niceColors that we use (@bjornstar)
7+
- Update `@react-three/cannon` to v6.5.0 (@bjornstar)
8+
- Update `three-stdlib` to v2.17.3 (@bjornstar)
9+
- Update `vite` to v3.2.2 (@bjornstar)
10+
- Replace `vite-react-jsx` with `@vitejs/plugin-react` (@bjornstar)
11+
- Remove `nice-color-palettes` (@bjornstar)
12+
- Remove `@vitejs/plugin-react-refresh` (@bjornstar)
13+
314
## v2.3.0 - 2022-04-18
415

516
- Use accurate ref types for all hooks (@bjornstar)

packages/react-three-cannon-examples/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-three/cannon-examples",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "Examples for @react-three/cannon",
55
"private": true,
66
"scripts": {
@@ -20,7 +20,7 @@
2020
"not op_mini all"
2121
],
2222
"devDependencies": {
23-
"@react-three/cannon": "^6.2.0",
23+
"@react-three/cannon": "^6.5.0",
2424
"@react-three/drei": "^9.4.3",
2525
"@react-three/fiber": "^8.0.11",
2626
"@types/lodash-es": "^4.17.6",
@@ -31,7 +31,7 @@
3131
"@types/three": "^0.139.0",
3232
"@typescript-eslint/eslint-plugin": "^5.17.0",
3333
"@typescript-eslint/parser": "^5.17.0",
34-
"@vitejs/plugin-react-refresh": "^1.3.6",
34+
"@vitejs/plugin-react": "^2.2.0",
3535
"eslint": "^8.12.0",
3636
"eslint-config-prettier": "^8.5.0",
3737
"eslint-plugin-es": "^4.1.0",
@@ -40,17 +40,16 @@
4040
"eslint-plugin-typescript-enum": "^2.1.0",
4141
"lerp": "^1.0.3",
4242
"lodash-es": "^4.17.21",
43-
"nice-color-palettes": "3.0.0",
4443
"prettier": "^2.6.1",
4544
"react": "^18.0.0",
4645
"react-dom": "^18.0.0",
4746
"react-is": "^18.0.0",
4847
"react-router-dom": "^6.2.2",
4948
"styled-components": "^5.3.5",
5049
"three": "^0.139.1",
51-
"three-stdlib": "^2.8.12",
50+
"three-stdlib": "^2.17.3",
5251
"typescript": "^4.6.3",
53-
"vite": "^2.9.1",
52+
"vite": "^3.2.2",
5453
"vite-react-jsx": "^1.1.2",
5554
"zustand": "^3.7.1"
5655
},

packages/react-three-cannon-examples/src/App.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ function Demos() {
7070
export default function App() {
7171
return (
7272
<Router>
73-
{/* @ts-expect-error Not sure how to fix the type here */}
7473
<GlobalStyle />
7574
<Intro />
7675
</Router>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// From `nice-color-palettes`, this one is index 17
2+
export default ['#99b898', '#fecea8', '#ff847c', '#e84a5f', '#2a363b'] as const

packages/react-three-cannon-examples/src/demos/Pingpong/index.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Canvas, useFrame, useLoader } from '@react-three/fiber'
33
import lerp from 'lerp'
44
import clamp from 'lodash-es/clamp'
55
import { Suspense, useRef } from 'react'
6-
import type { Group, Loader, Material, Mesh, Object3D, Skeleton } from 'three'
6+
import type { Group, Material, Mesh, Object3D, Skeleton } from 'three'
77
import { TextureLoader } from 'three'
88
import { DRACOLoader } from 'three-stdlib/loaders/DRACOLoader'
99
import type { GLTF } from 'three-stdlib/loaders/GLTFLoader'
@@ -53,11 +53,7 @@ const extensions = (loader: GLTFLoader) => {
5353
}
5454

5555
function Paddle() {
56-
const { nodes, materials } = useLoader<PingPongGLTF, '/pingpong.glb'>(
57-
GLTFLoader,
58-
'/pingpong.glb',
59-
extensions as (loader: Loader) => void,
60-
) as PingPongGLTF
56+
const { nodes, materials } = useLoader(GLTFLoader, '/pingpong.glb', extensions) as PingPongGLTF
6157
const { pong } = useStore((state) => state.api)
6258
const welcome = useStore((state) => state.welcome)
6359
const count = useStore((state) => state.count)

packages/react-three-cannon-examples/src/demos/demo-CubeHeap.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import type { PlaneProps, Triplet } from '@react-three/cannon'
22
import { Physics, useBox, usePlane, useSphere } from '@react-three/cannon'
33
import { Canvas, useFrame } from '@react-three/fiber'
4-
import niceColors from 'nice-color-palettes'
54
import { useMemo, useRef, useState } from 'react'
65
import type { InstancedMesh, Mesh } from 'three'
76
import { Color } from 'three'
87

8+
import niceColors from '../colors'
9+
910
function Plane(props: PlaneProps) {
1011
const [ref] = usePlane(() => ({ ...props }), useRef<Mesh>(null))
1112
return (
@@ -78,7 +79,7 @@ export default () => {
7879
const color = new Color()
7980
for (let i = 0; i < number; i++)
8081
color
81-
.set(niceColors[17][Math.floor(Math.random() * 5)])
82+
.set(niceColors[Math.floor(Math.random() * 5)])
8283
.convertSRGBToLinear()
8384
.toArray(array, i * 3)
8485
return array

packages/react-three-cannon-examples/src/demos/demo-Heightfield.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import type { Triplet } from '@react-three/cannon'
22
import { Physics, useHeightfield, useSphere } from '@react-three/cannon'
33
import type { Node } from '@react-three/fiber'
44
import { Canvas, extend, useFrame, useThree } from '@react-three/fiber'
5-
import niceColors from 'nice-color-palettes'
65
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react'
76
import type { BufferGeometry, InstancedMesh, Mesh, PerspectiveCamera } from 'three'
87
import { Color, Float32BufferAttribute } from 'three'
98
import { OrbitControls } from 'three-stdlib/controls/OrbitControls'
109

10+
import niceColors from '../colors'
11+
1112
extend({ OrbitControls })
1213

1314
declare global {
@@ -128,7 +129,7 @@ function Heightfield({
128129

129130
return (
130131
<mesh ref={ref} castShadow receiveShadow>
131-
<meshPhongMaterial color={niceColors[17][4]} />
132+
<meshPhongMaterial color={niceColors[4]} />
132133
<HeightmapGeometry heights={heights} elementSize={elementSize} />
133134
</mesh>
134135
)
@@ -153,7 +154,7 @@ function Spheres({ columns, rows, spread }: { columns: number; rows: number; spr
153154
const color = new Color()
154155
for (let i = 0; i < number; i++)
155156
color
156-
.set(niceColors[17][Math.floor(Math.random() * 5)])
157+
.set(niceColors[Math.floor(Math.random() * 5)])
157158
.convertSRGBToLinear()
158159
.toArray(array, i * 3)
159160
return array

packages/react-three-cannon-examples/src/demos/demo-KinematicCube.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import type { PlaneProps, Triplet } from '@react-three/cannon'
22
import { Physics, useBox, usePlane, useSphere } from '@react-three/cannon'
33
import type { MeshPhongMaterialProps } from '@react-three/fiber'
44
import { Canvas, useFrame } from '@react-three/fiber'
5-
import niceColors from 'nice-color-palettes'
65
import { useMemo, useRef } from 'react'
76
import type { InstancedMesh, Mesh } from 'three'
87
import { Color } from 'three'
98

9+
import niceColors from '../colors'
10+
1011
type OurPlaneProps = Pick<MeshPhongMaterialProps, 'color'> & Pick<PlaneProps, 'position' | 'rotation'>
1112

1213
function Plane({ color, ...props }: OurPlaneProps) {
@@ -49,7 +50,7 @@ function InstancedSpheres({ number = 100 }) {
4950
const color = new Color()
5051
for (let i = 0; i < number; i++)
5152
color
52-
.set(niceColors[17][Math.floor(Math.random() * 5)])
53+
.set(niceColors[Math.floor(Math.random() * 5)])
5354
.convertSRGBToLinear()
5455
.toArray(array, i * 3)
5556
return array
@@ -79,11 +80,11 @@ export default () => (
7980
/>
8081
<pointLight position={[-30, 0, -30]} intensity={0.5} />
8182
<Physics gravity={[0, 0, -30]}>
82-
<Plane color={niceColors[17][4]} position={[0, 0, 0]} rotation={[0, 0, 0]} />
83-
<Plane color={niceColors[17][1]} position={[-6, 0, 0]} rotation={[0, 0.9, 0]} />
84-
<Plane color={niceColors[17][2]} position={[6, 0, 0]} rotation={[0, -0.9, 0]} />
85-
<Plane color={niceColors[17][3]} position={[0, 6, 0]} rotation={[0.9, 0, 0]} />
86-
<Plane color={niceColors[17][0]} position={[0, -6, 0]} rotation={[-0.9, 0, 0]} />
83+
<Plane color={niceColors[4]} position={[0, 0, 0]} rotation={[0, 0, 0]} />
84+
<Plane color={niceColors[1]} position={[-6, 0, 0]} rotation={[0, 0.9, 0]} />
85+
<Plane color={niceColors[2]} position={[6, 0, 0]} rotation={[0, -0.9, 0]} />
86+
<Plane color={niceColors[3]} position={[0, 6, 0]} rotation={[0.9, 0, 0]} />
87+
<Plane color={niceColors[0]} position={[0, -6, 0]} rotation={[-0.9, 0, 0]} />
8788
<Box />
8889
<InstancedSpheres number={100} />
8990
</Physics>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import reactRefresh from '@vitejs/plugin-react-refresh'
1+
import react from '@vitejs/plugin-react'
22
import { defineConfig } from 'vite'
3-
import reactJsx from 'vite-react-jsx'
43

5-
export default defineConfig({ plugins: [reactJsx(), reactRefresh()] })
4+
export default defineConfig({ plugins: [react()] })

packages/react-three-cannon/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# @react-three/cannon Changelog
22

3+
## v6.5.0 - 2022-11-03
4+
5+
- Update `@pmndrs/cannon-worker-api` to v2.3.0 (@bjornstar)
6+
37
## v6.4.0 - 2022-08-18
48

59
- Add support for `frictionGravity` on WorldProps (@chnicoloso)

packages/react-three-cannon/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-three/cannon",
3-
"version": "6.4.0",
3+
"version": "6.5.0",
44
"description": "physics based hooks for react-three-fiber",
55
"keywords": [
66
"cannon",
@@ -30,7 +30,7 @@
3030
"prettier-fix": "prettier --write ."
3131
},
3232
"dependencies": {
33-
"@pmndrs/cannon-worker-api": "^2.1.0",
33+
"@pmndrs/cannon-worker-api": "^2.3.0",
3434
"cannon-es": "^0.20.0",
3535
"cannon-es-debugger": "^1.0.0"
3636
},

0 commit comments

Comments
 (0)