Skip to content

Commit

Permalink
[v1] SSR handling (#30)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this is the start of v1 beta

* remove new TextureLoader from top level import

* run prettier
  • Loading branch information
joshuaellis authored Mar 8, 2021
1 parent 2dce5f5 commit 95fd039
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 562 deletions.
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
dist
.github
.github
.next
node_modules
storybook-static
3 changes: 2 additions & 1 deletion demos/ssr/components/Controls.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react'
// @ts-ignore
import { OrbitControls } from 'three-stdlib'
import { useThree } from 'react-three-fiber'

Expand All @@ -22,5 +23,5 @@ export const Controls = () => {
}
}, [controls, invalidate])

return <primitive dispose={undefined} object={controls} enableDamping />
return controls ? <primitive dispose={undefined} object={controls} enableDamping /> : null
}
3 changes: 3 additions & 0 deletions demos/ssr/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
future: { webpack5: true },
}
1 change: 1 addition & 0 deletions demos/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"devDependencies": {
"@types/node": "^14.14.31",
"@types/react": "^17.0.2",
"@types/styled-components": "^5.1.7",
"babel-plugin-styled-components": "^1.12.0",
"typescript": "^4.2.2"
}
Expand Down
22 changes: 13 additions & 9 deletions demos/ssr/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"target": "es6",
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"jsx": "preserve",
"strict": true,
"skipLibCheck": true,
"isolatedModules": true,
"jsx": "preserve"
"forceConsistentCasingInFileNames": true,
"preserveWatchOutput": true,
"outDir": "lib",
"noImplicitThis": false,
"baseUrl": "./src",
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
Expand Down
Loading

0 comments on commit 95fd039

Please sign in to comment.