Skip to content

Commit 94f0445

Browse files
committed
rspack: get hot module reloading and dev server integration with nextjs to work
1 parent 2c75474 commit 94f0445

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

src/packages/frontend/frame-editors/jupyter-editor/snippets/main.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,10 @@ export const JupyterSnippets: React.FC<Props> = React.memo((props: Props) => {
532532
ellipsis={{ rows: 1, expandable: true, symbol: "more" }}
533533
>
534534
<Typography.Text strong>Code Snippets</Typography.Text> is a collection
535-
of examples for the current programming language. Go ahead and expand
536-
the categories to see them and use the "{BUTTON_TEXT}" button to copy
537-
the snippet into your notebook. If there is some text in the search box,
538-
it shows you some of the matching snippets. Something missing? Please{" "}
535+
of examples for the current programming language. Expand the categories
536+
to see them and use the "{BUTTON_TEXT}" button to copy the snippet into
537+
your notebook. If there is some text in the search box, it shows you
538+
some of the matching snippets. Something missing? Please{" "}
539539
<A href={URL}>contribute snippets</A> or create your own personal
540540
"Custom Snippets" as described at the very bottom below.
541541
</Typography.Paragraph>

src/packages/frontend/jupyter/status.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ export function Kernel({
552552
<Tooltip
553553
title={
554554
<>
555-
Percent of code cells that have been run since the last
556-
kernel restart.
555+
Percent of code cells that have been run since the
556+
kernel started.
557557
</>
558558
}
559559
>

src/packages/hub/servers/express-app.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { join } from "path";
1010
import { parse as parseURL } from "url";
1111
import webpackDevMiddleware from "webpack-dev-middleware";
1212
import webpackHotMiddleware from "webpack-hot-middleware";
13-
1413
import { path as WEBAPP_PATH } from "@cocalc/assets";
1514
import basePath from "@cocalc/backend/base-path";
1615
import { path as CDN_PATH } from "@cocalc/cdn";
@@ -195,22 +194,22 @@ async function initStatic(router) {
195194
let compiler: any = null;
196195
if (
197196
process.env.NODE_ENV != "production" &&
198-
!process.env.NO_WEBPACK_DEV_SERVER
197+
!process.env.NO_RSPACK_DEV_SERVER
199198
) {
200-
// Try to use the integrated webpack dev server, if it is installed.
199+
// Try to use the integrated rspack dev server, if it is installed.
201200
// It might not be installed at all, e.g., in production, and there
202201
// @cocalc/static can't even be imported.
203202
try {
204-
const { webpackCompiler } = require("@cocalc/static/webpack-compiler");
205-
compiler = webpackCompiler();
206-
} catch (_err) {
207-
console.warn("webpack is not available");
203+
const { rspackCompiler } = require("@cocalc/static/rspack-compiler");
204+
compiler = rspackCompiler();
205+
} catch (err) {
206+
console.warn("rspack is not available", err);
208207
}
209208
}
210209

211210
if (compiler != null) {
212211
console.warn(
213-
"\n-----------\n| WEBPACK: Running webpack dev server for frontend /static app.\n| Set env variable NO_WEBPACK_DEV_SERVER to disable.\n-----------\n",
212+
"\n-----------\n| RSPACK: Running rspack dev server for frontend /static app.\n| Set env variable NO_RSPACK_DEV_SERVER to disable.\n-----------\n",
214213
);
215214
router.use("/static", webpackDevMiddleware(compiler, {}));
216215
router.use("/static", webpackHotMiddleware(compiler, {}));

src/packages/static/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "./dist-ts/src/index.js",
66
"exports": {
77
".": "./dist-ts/src/index.js",
8-
"./webpack-compiler": "./dist-ts/src/webpack-compiler.js"
8+
"./rspack-compiler": "./dist-ts/src/rspack-compiler.js"
99
},
1010
"scripts": {
1111
"preinstall": "npx only-allow pnpm",
@@ -16,7 +16,7 @@
1616
"webpack-measure": "COCALC_OUTPUT=dist-measure MEASURE=true NODE_ENV=development pnpm webpack ",
1717
"webpack-measure-prod": "COCALC_OUTPUT=dist-prod-measure MEASURE=true pnpm webpack-prod",
1818
"build": "pnpm run build-dev && ./production-build.py",
19-
"build-dev": "pnpm run copy-css && cd src && ../../node_modules/.bin/tsc --build && pnpm rspack build -m development ",
19+
"build-dev": "pnpm run copy-css && cd src && ../../node_modules/.bin/tsc --build",
2020
"watch": "pnpm rspack build -m development -w",
2121
"test": "pnpm exec jest",
2222
"prepublishOnly": "pnpm test"

src/scripts/g.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export DEBUG="cocalc:*"
88
#export DEBUG_CONSOLE="yes"
99
unset DEBUG_CONSOLE
1010

11-
export NO_WEBPACK_DEV_SERVER=true
1211
#export COCALC_DISABLE_API_VALIDATION=yes
12+
#export NO_RSPACK_DEV_SERVER=yes
1313
#ulimit -Sv 120000000
1414

1515
while true; do

0 commit comments

Comments
 (0)