Skip to content

Commit 772d98a

Browse files
committed
Merge branch 'master' into vscode/next
2 parents 179e4f4 + 40278af commit 772d98a

File tree

49 files changed

+3059
-2160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3059
-2160
lines changed

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@
6969
"mdast-util-from-markdown": "^2.0.0",
7070
"mdast-util-to-hast": "^13.0.0",
7171
"normalize.css": "^8.0.1",
72-
"phaser": "~3.87.0",
72+
"phaser": "~3.90.0",
7373
"query-string": "^9.0.0",
7474
"re-resizable": "^6.9.9",
7575
"react": "^18.3.1",
7676
"react-ace": "^14.0.0",
7777
"react-copy-to-clipboard": "^5.1.0",
7878
"react-debounce-render": "^8.0.2",
7979
"react-dom": "^18.3.1",
80-
"react-drag-drop-files": "^2.3.10",
80+
"react-drag-drop-files": "^3.0.0",
8181
"react-draggable": "^4.4.5",
8282
"react-dropzone": "^14.2.3",
8383
"react-i18next": "^15.0.0",
@@ -87,7 +87,7 @@
8787
"react-papaparse": "^4.0.2",
8888
"react-qr-reader": "^3.0.0-beta-1",
8989
"react-redux": "^8.1.1",
90-
"react-router-dom": "^6.14.1",
90+
"react-router": "^7.6.2",
9191
"react-select": "^5.7.3",
9292
"react-simple-keyboard": "^3.6.27",
9393
"react-sortable-hoc": "^2.0.0",
@@ -108,6 +108,7 @@
108108
"yareco": "^0.1.5"
109109
},
110110
"devDependencies": {
111+
"@aaroon/workbox-rspack-plugin": "^0.3.2",
111112
"@babel/core": "^7.24.5",
112113
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
113114
"@babel/preset-typescript": "^7.24.1",
@@ -122,16 +123,16 @@
122123
"@svgr/webpack": "^8.0.0",
123124
"@swc/core": "^1.11.22",
124125
"@swc/jest": "^0.2.38",
126+
"@testing-library/dom": "^10.4.0",
125127
"@testing-library/jest-dom": "^6.0.0",
126-
"@testing-library/react": "^15.0.6",
128+
"@testing-library/react": "^16.0.0",
127129
"@testing-library/user-event": "^14.4.3",
128-
"@types/dompurify": "^3.0.5",
129130
"@types/estree": "^1.0.5",
130-
"@types/gapi": "^0.0.44",
131-
"@types/gapi.auth2": "^0.0.57",
131+
"@types/gapi": "^0.0.47",
132+
"@types/gapi.auth2": "^0.0.61",
132133
"@types/gapi.client": "^1.0.5",
133134
"@types/gapi.client.drive-v3": "^0.0.5",
134-
"@types/google.picker": "^0.0.39",
135+
"@types/google.picker": "^0.0.51",
135136
"@types/identity-obj-proxy": "^3",
136137
"@types/jest": "^29.0.0",
137138
"@types/js-cookie": "^3.0.6",

renovate.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
"extends": [
44
"config:recommended",
55
":dependencyDashboard",
6-
"group:allNonMajor",
76
":label(dependencies)"
87
],
9-
"major": {
10-
"dependencyDashboardApproval": true
11-
},
128
"packageRules": [
139
{
1410
"rangeStrategy": "update-lockfile",

rsbuild.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
44
import { pluginReact } from '@rsbuild/plugin-react';
55
import { pluginSass } from '@rsbuild/plugin-sass';
66
import { pluginSvgr } from '@rsbuild/plugin-svgr';
7+
import { InjectManifest } from '@aaroon/workbox-rspack-plugin';
78

89
const { publicVars, rawPublicVars } = loadEnv({ prefixes: ['REACT_APP_'] });
910

@@ -118,6 +119,15 @@ export default defineConfig({
118119
// })
119120
// ];
120121

122+
config.plugins = [
123+
...config.plugins,
124+
new InjectManifest({
125+
swSrc: './src/service-worker.ts',
126+
swDest: 'service-worker.js',
127+
maximumFileSizeToCacheInBytes: 20 * 1024 * 1024,
128+
})
129+
];
130+
121131
// Workaround to suppress warnings caused by ts-morph in js-slang
122132
// if (config.module) {
123133
// config.module.noParse = /node_modules\/@ts-morph\/common\/dist\/typescript\.js$/;

src/commons/ReactRouterPrompt.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* Intermediate implementation of deprecated <Prompt /> component
3-
* from react-router-dom's v5 to v6 upgrade.
3+
* from react-router's v5 to v6 upgrade.
44
*
5-
* react-router-dom plans to bring <Prompt /> back in the future. Until then,
5+
* react-router plans to bring <Prompt /> back in the future. Until then,
66
* we can use this suggested implementation.
77
*
88
* See: https://github.com/remix-run/react-router/issues/8139#issuecomment-1382428200
99
*/
1010
import React from 'react';
11-
import { useBeforeUnload, useBlocker } from 'react-router-dom';
11+
import { useBeforeUnload, useBlocker } from 'react-router';
1212

1313
// You can abstract `useBlocker` to use the browser's `window.confirm` dialog to
1414
// determine whether or not the user should navigate within the current origin.

src/commons/__tests__/__snapshots__/Markdown.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ exports[`Markdown page renders correctly 1`] = `
66
dangerouslySetInnerHTML={
77
{
88
"__html": "<p>Welcome to the Source Academy playground!</p>
9-
<p>The book <a target="_blank" rel="noopener noreferrer" href="https://sourceacademy.org/sicpjs/"><em>Structure and Interpretation of Computer Programs, JavaScript Edition</em></a>
10-
uses JavaScript sublanguages that we call <a target="_blank" rel="noopener noreferrer" href="https://docs.sourceacademy.org/"><em>Source</em></a>. You have chosen the sublanguage <a target="_blank" rel="noopener noreferrer" href="https://docs.sourceacademy.org/source_1/"><em>Source §1</em></a>.</p>
11-
<p>In the editor on the left, you can use the <a target="_blank" rel="noopener noreferrer" href="https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts"><em>Ace keyboard shortcuts</em></a>
12-
and also the <a target="_blank" rel="noopener noreferrer" href="https://github.com/source-academy/frontend/wiki/Source-Academy-Keyboard-Shortcuts"><em>Source Academy keyboard shortcuts</em></a>.</p>",
9+
<p>The book <a href="https://sourceacademy.org/sicpjs/" rel="noopener noreferrer" target="_blank"><em>Structure and Interpretation of Computer Programs, JavaScript Edition</em></a>
10+
uses JavaScript sublanguages that we call <a href="https://docs.sourceacademy.org/" rel="noopener noreferrer" target="_blank"><em>Source</em></a>. You have chosen the sublanguage <a href="https://docs.sourceacademy.org/source_1/" rel="noopener noreferrer" target="_blank"><em>Source §1</em></a>.</p>
11+
<p>In the editor on the left, you can use the <a href="https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts" rel="noopener noreferrer" target="_blank"><em>Ace keyboard shortcuts</em></a>
12+
and also the <a href="https://github.com/source-academy/frontend/wiki/Source-Academy-Keyboard-Shortcuts" rel="noopener noreferrer" target="_blank"><em>Source Academy keyboard shortcuts</em></a>.</p>",
1313
}
1414
}
1515
/>

src/commons/application/Application.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { useDispatch } from 'react-redux';
3-
import { Outlet } from 'react-router-dom';
3+
import { Outlet } from 'react-router';
44
import Messages, {
55
MessageType,
66
MessageTypeNames,

src/commons/application/ApplicationWrapper.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { IconNames } from '@blueprintjs/icons';
33
import classNames from 'classnames';
44
import { useEffect, useMemo, useState } from 'react';
55
import { useDispatch } from 'react-redux';
6-
import { RouterProvider } from 'react-router';
7-
import { createBrowserRouter } from 'react-router-dom';
6+
import { createBrowserRouter, RouterProvider } from 'react-router';
87
import { getAcademyRoutes } from 'src/pages/academy/academyRoutes';
98

109
import { getFullAcademyRouterConfig, playgroundOnlyRouterConfig } from '../../routes/routerConfig';
@@ -38,9 +37,7 @@ const ApplicationWrapper: React.FC = () => {
3837
? playgroundOnlyRouterConfig
3938
: getFullAcademyRouterConfig({ name, isLoggedIn, courseId, academyRoutes });
4039

41-
const r = createBrowserRouter(routerConfig, {
42-
future: { v7_relativeSplatPath: true }
43-
});
40+
const r = createBrowserRouter(routerConfig);
4441
dispatch(updateReactRouter(r));
4542

4643
return r;

src/commons/application/actions/CommonsActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Router } from '@remix-run/router';
1+
import { Router } from 'src/commons/application/types/CommonsTypes';
22
import { createActions } from 'src/commons/redux/utils';
33

44
const CommonsActions = createActions('commons', {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import { Router } from '@remix-run/router';
1+
import type { createBrowserRouter } from 'react-router';
22

3+
export type Router = ReturnType<typeof createBrowserRouter>;
34
export type RouterState = Router | null;

src/commons/assessment/Assessment.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import classNames from 'classnames';
2222
import { sortBy } from 'lodash';
2323
import React, { useEffect, useMemo, useState } from 'react';
2424
import { useDispatch } from 'react-redux';
25-
import { Navigate, useLoaderData, useParams } from 'react-router';
26-
import { NavLink } from 'react-router-dom';
25+
import { Navigate, NavLink, useLoaderData, useParams } from 'react-router';
2726
import { numberRegExp } from 'src/features/academy/AcademyTypes';
2827
import Messages, { sendToWebview } from 'src/features/vscode/messages';
2928
import classes from 'src/styles/Academy.module.scss';

0 commit comments

Comments
 (0)