Before this commit, the exports field of `@theatre/r3f` was:
```
"exports": {
".": "./dist/index.js",
"./extension": "./dist/extension/index.js"
},
```
So users could import the extension from '@theatre/r3f/extension'
However, if the user’s bundler doesn’t support the exports field, they’d have to import from @theatre/r3f/dist/extension. There are 3 problems with this approach:
1. We have to ask users to try both paths and see which works for their bundler.
2. Users can’t copy code from each other if their bundler setups are different.
3. To make matters worse, if a user’s bundler supports exports, they can’t import from @theatre/r3f/dist/extension.
This is all confusing, so we're fixing it by exposing @theatrer/3f/dist/extension and not @theatre/r3f/extension. Uglier, but more consistent, and avoids the above 3 problems.
* Minify r3f extension bundle, because it is expected by the React dead code elimination check, since we bundle React in it
* Add children to props, since it is required by React 18 types
* Fix getting context attributes for gl in ReferenceWindow
* Don't bundle threejs in extension
* Fix editor not responding to scene initialization
* Fix SnapshotEditor css
* Fix `process.env.version` in browser-bundles
- also fix tsdoc warns in mjs files
Co-authored-by: Fülöp Kovács <kovacs.fulop@gmail.com>
Co-authored-by: Cole Lawrence <cole@colelawrence.com>
* Change to `process.env.THEATRE_VERSION`
Co-authored-by: Fülöp Kovács <kovacs.fulop@gmail.com>
Co-authored-by: Cole Lawrence <cole@colelawrence.com>
This implements some basic infra for testing Theatre.js with popular setups such as npm/yarn/pnpm, webpack/vite/parcel, js/ts, etc.
So far, the only existing setup has been with create-react-app. Will add more in the future.
Co-authored-by: Fülöp <fulopkovacs@users.noreply.github.com>
Co-authored-by: Aria Minaei <aria.minaei@gmail.com>
* Support multiple/nested sheets and sheet instances
* Add playground for instances
* Fix playground and example
* Change r3f's objectKey to storeKey to avoid confusion
* Update all editable/uniqueName variables used as store key to storeKey too
* Fix lint warnings
* Make editable schema based and fix a couple UX issues
* Refactor the icons a bit
* Add support for points, lines, line segments, and line loops
* Adjust nudge multipliers
* Fix types
* Fix helpers not showing on hover in some cases
* 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