-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: enable streaming ssr * feat: enable toggle streaming * fix: add preset-typescript * docs: update contributing.md * chore: bump 5.0.2
- Loading branch information
Antony Budianto
authored
May 7, 2022
1 parent
4dda869
commit 2710b10
Showing
17 changed files
with
130 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@cra-express/core", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Core module for cra-universal server", | ||
"main": "lib/index.js", | ||
"files": [ | ||
|
@@ -20,8 +20,8 @@ | |
"express": "^4.18.1" | ||
}, | ||
"dependencies": { | ||
"@cra-express/static-loader": "^5", | ||
"@cra-express/universal-loader": "^5" | ||
"@cra-express/static-loader": "^5.0.2", | ||
"@cra-express/universal-loader": "^5.0.2" | ||
}, | ||
"author": "Antony Budianto <[email protected]>", | ||
"license": "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
import { Component } from 'react'; | ||
import { Suspense } from 'react'; | ||
import { ErrorBoundary } from 'react-error-boundary'; | ||
|
||
import './App.css'; | ||
import { ReactComponent as ReactSVG } from './react.svg'; | ||
import LazyContent1 from './Content/lazy1'; | ||
import LazyContent2 from './Content/lazy2'; | ||
|
||
class App extends Component { | ||
render() { | ||
return ( | ||
<div className="App"> | ||
<div className="App-header"> | ||
<h2>Welcome to React</h2> | ||
</div> | ||
<ReactSVG width={200} height={200} /> | ||
<p className="App-intro"> | ||
To get started, edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
const ErrorFallback = () => <div>Error</div>; | ||
|
||
const App = () => { | ||
return ( | ||
<div className="App"> | ||
<div className="App-header"> | ||
<h2>Welcome to React</h2> | ||
</div> | ||
); | ||
} | ||
} | ||
<ReactSVG width={200} height={200} /> | ||
<p className="App-intro"> | ||
To get started, edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
<LazyContent2 /> | ||
<Suspense fallback={<div>Loading, please wait...</div>}> | ||
<ErrorBoundary FallbackComponent={ErrorFallback}> | ||
<LazyContent1 /> | ||
</ErrorBoundary> | ||
</Suspense> | ||
</div> | ||
); | ||
}; | ||
|
||
App.defaultProps = { | ||
streaming: true, | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const Content1 = () => { | ||
return <div>LazyContent1 - with Suspense</div>; | ||
}; | ||
|
||
export default Content1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const Content2 = () => { | ||
return <div>LazyContent2 - no Suspense</div>; | ||
}; | ||
|
||
export default Content2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { lazy } from 'react'; | ||
|
||
/** | ||
* Demonstrate lazy with Suspense | ||
*/ | ||
const LazyContent1 = lazy(() => import('./Content1')); | ||
|
||
export default LazyContent1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { lazy } from 'react'; | ||
|
||
/** | ||
* Demonstrate "always" SSR component | ||
*/ | ||
const LazyContent2 = lazy(() => import('./Content2')); | ||
|
||
export default LazyContent2; |