Skip to content

Commit

Permalink
Update ssr fixtures to use bootstrapScripts instead of manual script tag
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Oct 20, 2021
1 parent 96acc3e commit 77c41b8
Show file tree
Hide file tree
Showing 7 changed files with 5,282 additions and 13 deletions.
1 change: 1 addition & 0 deletions fixtures/ssr/server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function render(url, res) {
});
let didError = false;
const {pipe, abort} = renderToPipeableStream(<App assets={assets} />, {
bootstrapScripts: [assets['main.js']],
onCompleteShell() {
// If something errored before we started streaming, we set the error code appropriately.
res.statusCode = didError ? 500 : 200;
Expand Down
1 change: 0 additions & 1 deletion fixtures/ssr/src/components/Chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default class Chrome extends Component {
__html: `assetManifest = ${JSON.stringify(assets)};`,
}}
/>
<script src={assets['main.js']} />
</body>
</html>
);
Expand Down
10 changes: 1 addition & 9 deletions fixtures/ssr/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4265,7 +4265,7 @@ longest@^1.0.1:
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=

loose-envify@^1.0.0, loose-envify@^1.1.0:
loose-envify@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
Expand Down Expand Up @@ -5945,14 +5945,6 @@ sax@^1.2.1, sax@~1.2.1:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

scheduler@^0.20.1:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
Expand Down
4 changes: 2 additions & 2 deletions fixtures/ssr2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"concurrently": "^5.3.0",
"express": "^4.17.1",
"nodemon": "^2.0.6",
"react": "18.0.0-alpha-7ec4c5597",
"react-dom": "18.0.0-alpha-7ec4c5597",
"react": "link:../../build/node_modules/react",
"react-dom": "link:../../build/node_modules/react-dom",
"react-error-boundary": "^3.1.3",
"resolve": "1.12.0",
"rimraf": "^3.0.2",
Expand Down
1 change: 1 addition & 0 deletions fixtures/ssr2/server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = function render(url, res) {
<App assets={assets} />
</DataProvider>,
{
bootstrapScripts: [assets['main.js']],
onCompleteShell() {
// If something errored before we started streaming, we set the error code appropriately.
res.statusCode = didError ? 500 : 200;
Expand Down
1 change: 0 additions & 1 deletion fixtures/ssr2/src/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default function Html({assets, children, title}) {
__html: `assetManifest = ${JSON.stringify(assets)};`,
}}
/>
<script async src={assets['main.js']} />
</body>
</html>
);
Expand Down
5,277 changes: 5,277 additions & 0 deletions fixtures/ssr2/yarn.lock

Large diffs are not rendered by default.

0 comments on commit 77c41b8

Please sign in to comment.