Skip to content

Commit

Permalink
@react-three/cannon v6.0.0 - 2022-04-01
Browse files Browse the repository at this point in the history
* v8

* Finish support for @react-three/fiber v8

* If it's in peerDependencies, it shouldn't be in devDependencies

Co-authored-by: Bjorn Stromberg <[email protected]>
  • Loading branch information
drcmda and bjornstar authored Apr 1, 2022
1 parent e2b0cc2 commit b8d3929
Show file tree
Hide file tree
Showing 13 changed files with 480 additions and 481 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @pmndrs/use-cannon Changelog

## v2.0.0 - 2022-04-01

- [@pmndrs/cannon-worker-api] v2.0.0
- [@react-three/cannon] v6.0.0
- [@react-three/cannon-examples] v2.0.0

## v1.1.0 - 2022-03-19

- [`package.json`] Add .json, .jsx, & .tsx to lint-staged files (@bjornstar)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pmndrs/use-cannon",
"version": "1.1.0",
"version": "2.0.0",
"description": "monorepo for @pmndrs/use-cannon",
"keywords": [
"cannon",
Expand Down
5 changes: 5 additions & 0 deletions packages/cannon-worker-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# @pmndrs/cannon-worker-api Changelog

## v2.0.0 - 2022-04-01

- `three.js` is now a `peerDependency` and requires r139 or higher
- Updated many `devDependencies`

## v1.1.0 - 2022-03-19

- [WorkerRayHitEvent] from & to are optional (@bjornstar)
Expand Down
36 changes: 18 additions & 18 deletions packages/cannon-worker-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pmndrs/cannon-worker-api",
"version": "1.1.0",
"version": "2.0.0",
"description": "An API to use cannon-es in a web worker",
"keywords": [
"cannon",
Expand Down Expand Up @@ -28,35 +28,35 @@
"prettier": "prettier --list-different .",
"prettier-fix": "prettier --write ."
},
"dependencies": {
"three": "^0.137.0"
},
"devDependencies": {
"@babel/core": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@babel/preset-typescript": "^7.16.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.2",
"@babel/core": "^7.17.8",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/events": "^3.0.0",
"@types/three": "^0.137.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"@types/three": "^0.139.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"cannon-es": "^0.19.0",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-typescript-enum": "^2.1.0",
"events": "^3.3.0",
"prettier": "^2.5.1",
"rollup": "^2.61.1",
"prettier": "^2.6.1",
"rollup": "^2.70.1",
"rollup-plugin-web-worker-loader": "^1.6.1",
"typescript": "^4.5.4"
"typescript": "^4.6.3"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix",
"*.{js,jsx,ts,tsx,md}": "prettier --write"
},
"peerDependencies": {
"three": ">=0.139"
}
}
6 changes: 6 additions & 0 deletions packages/react-three-cannon-examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @react-three/cannon-examples Changelog

## v2.0.0 - 2022-04-01

- Updated `react` to v18
- Updated `three.js` to r139
- Updated `@react-three/cannon` to v6

## v1.1.0 - 2022-03-19

- [MondayMorning] Don't use non-null assertions (@bjornstar)
Expand Down
52 changes: 26 additions & 26 deletions packages/react-three-cannon-examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-three/cannon-examples",
"version": "1.1.0",
"version": "2.0.0",
"description": "Examples for @react-three/cannon",
"private": true,
"scripts": {
Expand All @@ -20,39 +20,39 @@
"not op_mini all"
],
"devDependencies": {
"@react-three/cannon": "*",
"@react-three/drei": "^8.11.1",
"@react-three/fiber": "^7.0.26",
"@types/lodash-es": "^4.17.5",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"@types/react-router-dom": "^5.3.2",
"@types/styled-components": "^5.1.18",
"@types/three": "^0.137.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"@react-three/cannon": "^6.0.0",
"@react-three/drei": "^9.0.1",
"@react-three/fiber": "^8.0.4",
"@types/lodash-es": "^4.17.6",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.24",
"@types/three": "^0.139.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"@vitejs/plugin-react-refresh": "^1.3.6",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-typescript-enum": "^2.1.0",
"lerp": "^1.0.3",
"lodash-es": "^4.17.21",
"nice-color-palettes": "3.0.0",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"react-router-dom": "^6.2.1",
"styled-components": "^5.3.0",
"three": "^0.137.0",
"three-stdlib": "^2.8.8",
"typescript": "^4.5.4",
"vite": "^2.7.3",
"prettier": "^2.6.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-is": "^18.0.0",
"react-router-dom": "^6.2.2",
"styled-components": "^5.3.5",
"three": "^0.139.1",
"three-stdlib": "^2.8.12",
"typescript": "^4.6.3",
"vite": "^2.9.1",
"vite-react-jsx": "^1.1.2",
"zustand": "^3.6.7"
"zustand": "^3.7.1"
},
"lint-staged": {
"*.{js,ts}": "eslint --cache --fix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Spheres = ({ colors, number, size }: InstancedGeometryProps) => {
return (
<instancedMesh receiveShadow castShadow ref={ref} args={[undefined, undefined, number]}>
<sphereBufferGeometry args={[size, 48]}>
<instancedBufferAttribute attachObject={['attributes', 'color']} args={[colors, 3]} />
<instancedBufferAttribute attach="attributes-color" args={[colors, 3]} />
</sphereBufferGeometry>
<meshLambertMaterial vertexColors />
</instancedMesh>
Expand All @@ -49,7 +49,7 @@ const Boxes = ({ colors, number, size }: InstancedGeometryProps) => {
return (
<instancedMesh receiveShadow castShadow ref={ref} args={[undefined, undefined, number]}>
<boxBufferGeometry args={args}>
<instancedBufferAttribute attachObject={['attributes', 'color']} args={[colors, 3]} />
<instancedBufferAttribute attach="attributes-color" args={[colors, 3]} />
</boxBufferGeometry>
<meshLambertMaterial vertexColors />
</instancedMesh>
Expand Down Expand Up @@ -81,7 +81,6 @@ export default () => {

return (
<Canvas
mode="concurrent"
shadows
gl={{ alpha: false }}
camera={{ fov: 50, position: [-1, 1, 2.5] }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const Spheres: FC<{
return (
<instancedMesh ref={ref} castShadow receiveShadow args={[undefined, undefined, number]}>
<sphereBufferGeometry args={[0.2, 16, 16]}>
<instancedBufferAttribute attachObject={['attributes', 'color']} args={[colors, 3]} />
<instancedBufferAttribute attach="attributes-color" args={[colors, 3]} />
</sphereBufferGeometry>
<meshPhongMaterial vertexColors />
</instancedMesh>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ function InstancedSpheres({ number = 100 }) {
return (
<instancedMesh ref={ref} castShadow receiveShadow args={[undefined, undefined, number]}>
<sphereBufferGeometry args={[1, 16, 16]}>
<instancedBufferAttribute attachObject={['attributes', 'color']} args={[colors, 3]} />
<instancedBufferAttribute attach="attributes-color" args={[colors, 3]} />
</sphereBufferGeometry>
<meshPhongMaterial vertexColors />
</instancedMesh>
)
}

export default () => (
<Canvas mode="concurrent" shadows gl={{ alpha: false }} camera={{ position: [0, -12, 16] }}>
<Canvas shadows gl={{ alpha: false }} camera={{ position: [0, -12, 16] }}>
<hemisphereLight intensity={0.35} />
<spotLight
position={[30, 0, 30]}
Expand All @@ -75,7 +75,7 @@ export default () => (
/>
<pointLight position={[-30, 0, -30]} intensity={0.5} />
<Physics gravity={[0, 0, -30]}>
<Plane color={niceColors[17][4]} />
<Plane color={niceColors[17][4]} position={[0, 0, 0]} rotation={[0, 0, 0]} />
<Plane color={niceColors[17][1]} position={[-6, 0, 0]} rotation={[0, 0.9, 0]} />
<Plane color={niceColors[17][2]} position={[6, 0, 0]} rotation={[0, -0.9, 0]} />
<Plane color={niceColors[17][3]} position={[0, 6, 0]} rotation={[0.9, 0, 0]} />
Expand Down
11 changes: 11 additions & 0 deletions packages/react-three-cannon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @react-three/cannon Changelog

## v6.0.0 - 2022-04-01

- Removed the Suspense wrapper around Physics, you will need to provide your own suspense boundary from now on
- `react` is now a `peerDependency` and requires v18 or higher
- `three.js` is now a `peerDependency` and requires r139 or higher
- `@react-three/fiber` is now a `peerDependency` and requires v8 or higher
- `@pmndrs/cannon-worker-api` is now a `dependency`
- `cannon-es` is now a `dependency`
- `cannon-es-debugger` is now a `dependency`
- Updated many `devDependencies`

## v5.1.0 - 2022-03-19

- Access the physics context with the `usePhysicsContext` hook, which immediately gives you a clear error message when trying to access physics components or hooks outside of a Physics provider (@bjornstar)
Expand Down
49 changes: 25 additions & 24 deletions packages/react-three-cannon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-three/cannon",
"version": "5.1.0",
"version": "6.0.0",
"description": "physics based hooks for react-three-fiber",
"keywords": [
"cannon",
Expand Down Expand Up @@ -30,38 +30,39 @@
"prettier-fix": "prettier --write ."
},
"dependencies": {
"@react-three/fiber": "^7.0.26",
"react": ">=17.0",
"three": "^0.137.0"
"@pmndrs/cannon-worker-api": "^2.0.0",
"cannon-es": "^0.19.0",
"cannon-es-debugger": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@babel/preset-react": "^7.16.5",
"@babel/preset-typescript": "^7.16.5",
"@pmndrs/cannon-worker-api": "^1.1.0",
"@rollup/plugin-babel": "^5.3.0",
"@babel/core": "^7.17.8",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/react": "^17.0.37",
"@types/three": "^0.137.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"cannon-es": "^0.19.0",
"cannon-es-debugger": "^1.0.0",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"@types/react": "^17.0.43",
"@types/three": "^0.139.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-typescript-enum": "^2.1.0",
"prettier": "^2.5.1",
"react": "^17.0.2",
"rollup": "^2.61.1",
"typescript": "^4.5.4"
"prettier": "^2.6.1",
"rollup": "^2.70.1",
"typescript": "^4.6.3"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix",
"*.{js,jsx,ts,tsx,md}": "prettier --write"
},
"peerDependencies": {
"@react-three/fiber": ">=8",
"react": ">=18",
"three": ">=0.139"
}
}
15 changes: 2 additions & 13 deletions packages/react-three-cannon/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
import type { FC } from 'react'
import { Suspense } from 'react'

import type { PhysicsProviderProps } from './physics-provider'
import { PhysicsProvider } from './physics-provider'

export type { DebugProviderProps as DebugProps } from './debug-provider'
export { DebugProvider as Debug } from './debug-provider'
export * from './hooks'

export const Physics: FC<PhysicsProviderProps> = (props) => (
<Suspense fallback={null}>
<PhysicsProvider {...props} />
</Suspense>
)

export type { PhysicsProviderProps as PhysicsProps } from './physics-provider'
export { PhysicsProvider as Physics } from './physics-provider'
export type {
AtomicName,
AtomicProps,
Expand Down
Loading

1 comment on commit b8d3929

@vercel
Copy link

@vercel vercel bot commented on b8d3929 Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.