-
Notifications
You must be signed in to change notification settings - Fork 40
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
SWC-7242 #5630
base: develop
Are you sure you want to change the base?
SWC-7242 #5630
Changes from 8 commits
6fc5d6a
221862d
96e59cf
7007916
04c4e33
8a7df30
37fd037
6594330
73af0a6
0e64c9c
423ed94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
yarn lint-staged | ||
pnpm lint-staged |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,4 @@ gh api \ | |
unzip "${ARTIFACT_ZIP}" -d "${REPORT_DIR}" | ||
|
||
# Show report | ||
yarn e2e:report | ||
pnpm e2e:report |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vite will bundle this file, and the bundled asset will be emitted in the Portal HTML. This will replace the various UMD bundles that many packages are no longer providing. |
||
* Synapse Web Client JavaScript modules | ||
* | ||
* JavaScript dependencies that should be loaded to the global scope in SWC can be added here. | ||
* | ||
* This file will be bundled and loaded in the SWC application. Excess imports should be avoided to keep this | ||
* bundle as small as possible. | ||
*/ | ||
// vite/modulepreload-polyfill should be included per https://vite.dev/guide/backend-integration | ||
import 'vite/modulepreload-polyfill' | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import ReactDOMClient from 'react-dom/client' | ||
import * as ReactQuery from '@tanstack/react-query' | ||
import * as SRC from 'synapse-react-client' | ||
import './mui.js' | ||
|
||
// Append to global scope so these libraries can be accessed in JsInterop classes | ||
|
||
self.React = React | ||
self.ReactDOM = ReactDOM | ||
self.ReactDOMClient = ReactDOMClient | ||
|
||
self.ReactQuery = ReactQuery | ||
|
||
self.SRC = SRC |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Import and expose only the MUI components used in JsInterop | ||
import Unstable_Grid2 from '@mui/material/Unstable_Grid2' | ||
|
||
self.MaterialUI = { | ||
Unstable_Grid2, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it looks like we added a bunch of new dependencies, most of these are not new. With yarn v1, we could directly depend on artifacts from transitive dependencies. pnpm does not let you do this, so we have to add add those previously-transitive dependencies that we currently directly depend on. |
||
"type": "module", | ||
"dependencies": { | ||
"@emotion/react": "^11.14.0", | ||
"@emotion/styled": "^11.14.0", | ||
"@mui/material": "^5.16.14", | ||
"@sage-bionetworks/markdown-it-container": "^4.0.1", | ||
"@sage-bionetworks/synapse-types": "0.0.4", | ||
"@tanstack/react-query": "5.22.2", | ||
"animate.css": "^4.1.1", | ||
"bootstrap3": "npm:[email protected]", | ||
"croppie": "2.6.5", | ||
"font-awesome": "4.7.0", | ||
|
@@ -15,10 +22,11 @@ | |
"markdown-it-inline-comments": "^1.0.1", | ||
"markdown-it-math": "^4.1.1", | ||
"markdown-it-strikethrough-alt": "^1.0.0", | ||
"markdown-it-sub": "^2.0.0", | ||
"markdown-it-sup": "^2.0.0", | ||
Comment on lines
-18
to
-19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These were not used. We were already using the |
||
"markdown-it-sub-alt": "^1.0.0", | ||
"markdown-it-sup-alt": "^1.0.2", | ||
"markdown-it-synapse": "^1.1.17", | ||
"markdown-it-synapse-heading": "^1.0.1", | ||
"markdown-it-synapse-math": "^3.0.5", | ||
"markdown-it-synapse-table": "^1.0.8", | ||
"moment": "^2.29.4", | ||
"papaparse": "^5.4.1", | ||
|
@@ -27,15 +35,17 @@ | |
"prop-types": "^15.8.1", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-measure": "2.5.2", | ||
"react-plotly.js": "^2.6.0", | ||
"react-transition-group": "2.6.0", | ||
"sass": "^1.63.6", | ||
"spark-md5": "^3.0.2", | ||
"synapse-react-client": "3.3.41", | ||
"synapse-react-client": "3.4.0", | ||
"universal-cookie": "^4.0.4", | ||
"xss": "^1.0.15" | ||
}, | ||
"resolutions": { | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.48.0", | ||
"@prettier/plugin-xml": "^3.1.0", | ||
|
@@ -54,27 +64,31 @@ | |
"prettier-plugin-java": "2.5.0", | ||
"typescript": "5.1.6", | ||
"uuid": "^9.0.0", | ||
"vite": "^6.0.11", | ||
"vite-plugin-node-polyfills": "0.17.0", | ||
Comment on lines
+67
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Vite |
||
"wait-on": "^8.0.0" | ||
}, | ||
"lint-staged": { | ||
"*.{*}": "prettier --write" | ||
}, | ||
"scripts": { | ||
"build": "mvn -B package --file pom.xml", | ||
"dev": "concurrently -k -n \"CODESERVER,WATCHER,TOMCAT\" -c \"auto,auto,auto\" \"yarn dev:codeserver\" \"yarn dev:watcher\" \"yarn dev:tomcat\"", | ||
"dev": "pnpm concurrently -k -n \"CODESERVER,WATCHER,TOMCAT,VITE\" -c \"auto,auto,auto,auto\" \"pnpm dev:codeserver\" \"pnpm dev:watcher\" \"pnpm dev:tomcat\" \"pnpm dev:vite\"", | ||
"dev:codeserver": "mvn clean gwt:run-codeserver", | ||
"dev:watcher": "wait-on tcp:127.0.0.1:9876 && mvn fizzed-watcher:run", | ||
"dev:tomcat": "wait-on tcp:127.0.0.1:9876 && docker pull tomcat:9.0; docker run --name swc-dev --rm -p 8888:8080 -v \"/$(pwd)/target/portal-develop-SNAPSHOT/:/usr/local/tomcat/webapps/ROOT/\" -v \"/$HOME/.m2/settings.xml\":/root/.m2/settings.xml tomcat:9.0", | ||
"dev:tomcat": "wait-on tcp:127.0.0.1:9876 && docker pull tomcat:9.0; docker run --name swc-dev --rm -p 8888:8080 -v \"/$(pwd)/target/portal-develop-SNAPSHOT/:/usr/local/tomcat/webapps/ROOT/\" -v \"/$HOME/.m2/settings.xml\":/root/.m2/settings.xml -e CATALINA_OPTS=\"-Dorg.sagebionetworks.web.client.dev.mode=true\" tomcat:9.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add environment variable |
||
"dev:vite": "vite dev", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a script that runs the Vite dev server (live reloading of assets bundled by Vite) |
||
"docker:start": "docker pull tomcat:9.0; docker run --name swc-tomcat -d --rm -p 8888:8080 -v \"/$(pwd)/target/portal-develop-SNAPSHOT.war:/usr/local/tomcat/webapps/ROOT.war\" -v \"/$(pwd)/e2e_workflow/settings.xml\":/root/.m2/settings.xml tomcat:9.0", | ||
"docker:stop": "docker stop swc-tomcat", | ||
"prepare": "husky install", | ||
"e2e": "yarn playwright test", | ||
"e2e:chromium": "yarn playwright test --project=chromium", | ||
"e2e": "pnpm playwright test", | ||
"e2e:chromium": "pnpm playwright test --project=chromium", | ||
"e2e:lint": "eslint e2e", | ||
"e2e:ui": "yarn playwright test --ui", | ||
"e2e:codegen": "yarn playwright codegen", | ||
"e2e:report": "yarn playwright show-report", | ||
"e2e:report:blob": "yarn playwright merge-reports --reporter html ./blob-report && yarn e2e:report", | ||
"playwright:update": "yarn add -D @playwright/test@latest; yarn playwright install" | ||
} | ||
"e2e:ui": "pnpm playwright test --ui", | ||
"e2e:codegen": "pnpm playwright codegen", | ||
"e2e:report": "pnpm playwright show-report", | ||
"e2e:report:blob": "pnpm playwright merge-reports --reporter html ./blob-report && pnpm e2e:report", | ||
"playwright:update": "pnpm add -D @playwright/test@latest; pnpm playwright install" | ||
}, | ||
"packageManager": "[email protected]+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update Node to 22 (latest LTS) since it includes the latest version of corepack, which we will use to install pnpm.