feat(dev): move to rsbuild for dev - faster (#4674)

This commit is contained in:
Alireza authored and GitHub committed 2025-01-10 15:05:35 -05:00
1 parent 847f1da8e0
commit d4a4267429
33 files changed
+13177 -5660

No files matched your search

+1
View File
@@ -27,6 +27,7 @@
"build": "node --max_old_space_size=8096 ./../../node_modules/webpack/bin/webpack.js --progress --config .webpack/webpack.pwa.js",
"clean": "shx rm -rf dist",
"clean:deep": "yarn run clean && shx rm -rf node_modules",
"dev:fast": "rsbuild dev --config ../../rsbuild.config.ts",
"dev": "cross-env NODE_ENV=development webpack serve --config .webpack/webpack.pwa.js",
"dev:no:cache": "cross-env NODE_ENV=development webpack serve --no-cache --config .webpack/webpack.pwa.js",
"dev:orthanc": "cross-env NODE_ENV=development PROXY_TARGET=http://localhost:3000/pacs/dicom-web PROXY_DOMAIN=http://localhost:8042 PROXY_PATH_REWRITE_FROM=/pacs/dicom-web PROXY_PATH_REWRITE_TO=/dicom-web APP_CONFIG=config/docker-nginx-orthanc.js webpack serve --config .webpack/webpack.pwa.js",
@@ -206,7 +206,6 @@
/>
<link
href="https://fonts.googleapis.com/css?family=Inter:100,300,400,500,700&display=swap"
rel="stylesheet"
rel="preload"
as="style"
/>
@@ -3,10 +3,10 @@ import React, { useCallback, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { Enums, ExtensionManager, MODULE_TYPES, log } from '@ohif/core';
//
import { extensionManager } from '../App.tsx';
import { extensionManager } from '../App';
import { useParams, useLocation } from 'react-router';
import { useNavigate } from 'react-router-dom';
import useSearchParams from '../hooks/useSearchParams.ts';
import useSearchParams from '../hooks/useSearchParams';
/**
* Determines if two React Router location objects are the same.
+2 -2
View File
@@ -6,9 +6,9 @@ import { DicomMetadataStore, MODULE_TYPES } from '@ohif/core';
import Dropzone from 'react-dropzone';
import filesToStudies from './filesToStudies';
import { extensionManager } from '../../App.tsx';
import { extensionManager } from '../../App';
import { Button, Icon, LoadingIndicatorProgress } from '@ohif/ui';
import { Button, LoadingIndicatorProgress } from '@ohif/ui';
import { Icons } from '@ohif/ui-next';
const getLoadButton = (onDrop, text, isDir) => {
+1 -2
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { Routes, Route } from 'react-router-dom';
import { Routes, Route, Link } from 'react-router-dom';
import { ErrorBoundary } from '@ohif/ui-next';
// Route Components
@@ -11,7 +11,6 @@ import NotFound from './NotFound';
import buildModeRoutes from './buildModeRoutes';
import PrivateRoute from './PrivateRoute';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import publicUrl from '../utils/publicUrl';
const NotFoundServer = ({
@@ -43,7 +43,6 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
@@ -1,8 +1,6 @@
{
"repository": "OHIF/Viewers",
"keywords": [
"ohif-extension"
],
"keywords": ["ohif-extension"],
"module": "src/index.tsx",
"engines": {
"node": ">=14",
@@ -25,8 +23,8 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^12.2.2",
"react-router": "^6.8.1",
"react-router-dom": "^6.8.1",
"react-router": "^6.23.1",
"react-router-dom": "^6.23.1",
"webpack": "5.89.0",
"webpack-merge": "^5.7.3"
},
@@ -37,7 +37,6 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
@@ -13,3 +13,23 @@ window.PUBLIC_URL = '<%= PUBLIC_URL %>';
```
Was added before the `<!-- EXTENSIONS -->` comment block.
## OHIF Docs
OHIF platform/docs is no longer part of the workspace.
- Builds are faster for 99.99% of users since only maintainers need to run the docs development.
If you need to run the docs website locally, you must install it first, as it is not installed by default.
Before:
```bash
yarn run dev
```
After:
```bash
yarn install
yarn run dev
```
-13
View File
@@ -52,19 +52,6 @@ module.exports = {
favicon: 'img/favicon.ico',
themes: ['@docusaurus/theme-live-codeblock'],
plugins: [
() => ({
name: 'resolve-react',
configureWebpack() {
return {
resolve: {
alias: {
// assuming root node_modules is up from "./packages/<your-docusaurus>
react: path.resolve('../../node_modules/react'),
},
},
};
},
}),
// path.resolve(__dirname, './pluginOHIFWebpackConfig.js'),
// /path.resolve(__dirname, './postcss.js'),
'docusaurus-plugin-image-zoom', // 3rd party plugin for image click to pop
+3 -17
View File
@@ -2,17 +2,6 @@
"name": "ohif-docs",
"version": "3.10.0-beta.54",
"private": true,
"workspaces": {
"nohoist": [
"@docusaurus/core/**",
"@docusaurus/core",
"@docusaurus/preset-classic",
"@docusaurus/preset-classic/**",
"**/react-router-dom",
"**/react-router",
"**/history"
]
},
"scripts": {
"docusaurus": "docusaurus",
"clean": "shx rm -rf dist",
@@ -68,6 +57,7 @@
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"tailwindcss-animate": "^1.0.7",
"@svgr/webpack": "^5.5.0",
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.0",
@@ -90,13 +80,9 @@
"sonner": "^1.4.41",
"tailwind-merge": "^2.3.0",
"tailwindcss": "^3.4.13",
"url-loader": "^4.1.1"
},
"peerDependencies": {
"url-loader": "^4.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"react-dom": "^18.3.1",
"@docusaurus/module-type-aliases": "3.0.0",
"@docusaurus/tsconfig": "3.0.0",
"@docusaurus/types": "3.0.0",
File diff suppressed because it is too large. Load diff
-1
View File
@@ -50,7 +50,6 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['react-refresh/babel'],
ignore: ['**/*.test.jsx', '**/*.test.js', '__snapshots__', '__tests__'],
},
},
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';
import { Icons } from '@ohif/ui-next';
import PatientInfo from './PatientInfo';
import { PatientInfo } from './PatientInfo';
/**
* This is the modern Viewport Action Bar, showing patient info, series date,