Fix various issues with the build system (#129)

* Fix react-icons breaking in CRA 5 for some reason

* Replace fuzzysort with fuzzy so we don't break Webpack

Webpack messes up esbuild’s internal modules if the inlined module is an AMD module. Check any new dep you add if it is an AMD module.

* Inline dataverse deps.

Mainly because the CJS build consuming the ESM lodash-es broke some bundlers.

* react-icons fix nr 2

* Stop eslint breaking in CRA 5

* Update r3f-cra example to CRA 5 and fix double-bundling react & co

* Fix r3f tree-shaking and switch to ESM only output

* Make r3f example shake studio and its extension in prod

* Examples have separate and wildly differing build setups so remove them from the pre-commit hook linting

* Update out-of-date yarn.lock
This commit is contained in:
Andrew Prifer 2022-04-21 22:03:51 +02:00 committed by GitHub
parent f2089302d5
commit 39da042edc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 6066 additions and 218 deletions

View file

@ -0,0 +1,5 @@
{
"extends": [
"react-app"
]
}

View file

@ -7,15 +7,12 @@
},
"dependencies": {
"@react-three/drei": "^7.2.2",
"@react-three/fiber": "^7.0.6",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@theatre/core": "workspace:*",
"@theatre/r3f": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"react-scripts": "^5.0.1",
"three": "^0.130.1",
"web-vitals": "^1.0.1"
},

View file

@ -4,11 +4,13 @@ import {useState, useEffect, useRef} from 'react'
import {useFrame, Canvas} from '@react-three/fiber'
import {Shadow, softShadows} from '@react-three/drei'
import React from 'react'
import {editable as e, SheetProvider, extension} from '@theatre/r3f'
import studio from '@theatre/studio'
import {editable as e, SheetProvider, extension} from '@theatre/r3f'
studio.extend(extension)
studio.initialize()
if (process.env.NODE_ENV === 'development') {
studio.extend(extension)
studio.initialize()
}
// Soft shadows are expensive, comment and refresh when it's too slow
softShadows()