Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sitecore-jss-rendering-host] Retire devServer #1426

Merged
merged 6 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Our versioning strategy is as follows:

## Unreleased

### 🛠 Breaking Changes

* `[sitecore-jss-rendering-host]` devServer is retired. renderingHostServer is the only way to use rendering-host with react from now on. ([#1426](https://github.com/Sitecore/jss/pull/1426))
art-alexeyenko marked this conversation as resolved.
Show resolved Hide resolved

### 🎉 New Features & Improvements

* `[templates/nextjs-sxa]` Add custom template for _jss scaffold_ ([#1420](https://github.com/Sitecore/jss/pull/1420))
Expand Down
6 changes: 4 additions & 2 deletions packages/sitecore-jss-rendering-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
"url": "https://github.com/sitecore/jss/issues"
},
"dependencies": {
"compression": "^1.7.4",
"del": "^6.1.1",
"express": "^4.18.2",
"import-fresh": "^3.3.0",
"ngrok": "^4.3.3",
"opn": "^6.0.0",
"webpack": "5.76.2",
"webpack-dev-server": "3.11.0"
"webpack": "5.76.2"
},
"devDependencies": {
"@types/chai": "^4.2.3",
Expand All @@ -45,6 +46,7 @@
"@types/webpack-dev-middleware": "2.0.5",
"@types/webpack-dev-server": "3.1.7",
"chai": "^4.3.0",
"compression": "^1.7.2",
art-alexeyenko marked this conversation as resolved.
Show resolved Hide resolved
"del-cli": "^5.0.0",
"eslint": "^8.33.0",
"mocha": "^10.2.0",
Expand Down
27 changes: 0 additions & 27 deletions packages/sitecore-jss-rendering-host/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
export { startRenderHostTunnel } from './tunnel';
export { startDevServer } from './devServer';
export { ssrMiddleware } from './ssrMiddleware';
export { startRenderingHostServer } from './renderingHostServer';
export { getDefaultAppInvocationInfoResolver } from './defaultAppInvocationInfoResolver';

// const jssConfig = require('../scjssconfig.json');
// const ssrWebpackConfig = require('../server/server.webpack.config');
// const craWebpackConfig = require('../node_modules/react-scripts/config/webpack.config');
// const craWebpackDevServerConfig = require('../node_modules/react-scripts/config/webpackDevServer.config');

// doIt(5000);

// // invoking code, to be called from within sample app
// function doIt(port = 5000) {
// startRenderHostTunnel('http://localhost', { port })
// .then((tunnelUrl: string) => {
// // generateHtmlTemplate(tunnelUrl);
// startDevServer({
// port,
// tunnelUrl,
// configFactory,
// buildArtifactsPath: '../build',
// serverBundleFileName: 'server.bundle',
// urlToOpenOnStart: `${jssConfig.sitecore.layoutServiceHost}?sc_renderengineurl=${tunnelUrl}`,
// });
// })
// .catch((err: Error) => {
// console.error(err);
// });
// }
3 changes: 1 addition & 2 deletions packages/sitecore-jss-rendering-host/src/ssrMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export type WebServerMiddleware = (

export type SSRMiddleware = (options: SSRMiddlewareOptions) => WebServerMiddleware;

// don't assume this middleware will always be used by WebpackDevServer
// it may also be used by a "standalone" JSS rendering host / express server.
// may be used by a "standalone" JSS rendering host / express server.
export const ssrMiddleware: SSRMiddleware = ({
appInvocationInfoResolver,
}: SSRMiddlewareOptions) => {
Expand Down
21 changes: 0 additions & 21 deletions ref-docs/sitecore-jss-rendering-host/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

- [getDefaultAppInvocationInfoResolver](README.md#getdefaultappinvocationinforesolver)
- [ssrMiddleware](README.md#ssrmiddleware)
- [startDevServer](README.md#startdevserver)
- [startRenderHostTunnel](README.md#startrenderhosttunnel)
- [startRenderingHostServer](README.md#startrenderinghostserver)

Expand Down Expand Up @@ -66,26 +65,6 @@ ___

___

### startDevServer

▸ **startDevServer**(`config`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `config` | `DevServerOptions` |

#### Returns

`void`

#### Defined in

[devServer.ts:77](https://github.com/Sitecore/jss/blob/4cefcb5a/packages/sitecore-jss-rendering-host/src/devServer.ts#L77)

___

### startRenderHostTunnel

▸ **startRenderHostTunnel**(`renderHostname`, `options?`): `Promise`<`string`\>
Expand Down
Loading