Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

feat: integrate million js automatic mode (#430)

KunalVerma2468c130ce761cea
diff --git a/apps/admin/next.config.js b/apps/admin/next.config.js
index ed923291..78b3b13b 100644
--- a/apps/admin/next.config.js
+++ b/apps/admin/next.config.js
@@ -1,3 +1,10 @@
+// eslint-disable-next-line import/no-unresolved
+import million from 'million/compiler';
+
+const millionConfig = {
+ auto: { rsc: true },
+};
+
/** @type {import("next").NextConfig} */
const config = {
webpack: (config) => {
@@ -32,4 +39,4 @@ const config = {
},
swcMinify: true,
};
-export default config;
+export default million.next(config, millionConfig);
diff --git a/apps/admin/package.json b/apps/admin/package.json
index 411feb2e..3f7dcbef 100644
--- a/apps/admin/package.json
+++ b/apps/admin/package.json
@@ -25,6 +25,7 @@
"@tanstack/react-query": "^4.29.25",
"@tanstack/react-table": "^8.9.3",
"clsx": "^2.0.0",
+ "million": "2.6.0-beta.12",
"next": "13.4.19",
"next-auth": "^4.22.1",
"next-themes": "^0.2.1",
diff --git a/apps/og-image/next.config.js b/apps/og-image/next.config.js
index 4d81e444..edf4f1df 100644
--- a/apps/og-image/next.config.js
+++ b/apps/og-image/next.config.js
@@ -11,4 +11,3 @@ const config = {
swcMinify: true,
};
export default config;
-
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index 00a57cb8..3f616e0f 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -3,6 +3,12 @@
import vercelToolbar from '@vercel/toolbar/plugins/next';
import { withSentryConfig } from '@sentry/nextjs';
import bundleAnalyzer from '@next/bundle-analyzer';
+// eslint-disable-next-line import/no-unresolved
+import million from 'million/compiler';
+
+const millionConfig = {
+ auto: { rsc: true },
+};
/** @type {import("next").NextConfig} */
const nextConfig = {
@@ -44,35 +50,38 @@ const withBundleAnalyzer = bundleAnalyzer({
});
const withVercelToolbar = vercelToolbar();
-export default withSentryConfig(
- withBundleAnalyzer(withVercelToolbar(nextConfig)),
- {
- // For all available options, see:
- // https://github.com/getsentry/sentry-webpack-plugin#options
+export default million.next(
+ withSentryConfig(
+ withBundleAnalyzer(withVercelToolbar(nextConfig)),
+ {
+ // For all available options, see:
+ // https://github.com/getsentry/sentry-webpack-plugin#options
- // Suppresses source map uploading logs during build
- silent: true,
+ // Suppresses source map uploading logs during build
+ silent: true,
- org: 'typehero',
- project: 'typehero-web-production',
- },
- {
- // For all available options, see:
- // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
+ org: 'typehero',
+ project: 'typehero-web-production',
+ },
+ {
+ // For all available options, see:
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
- // Upload a larger set of source maps for prettier stack traces (increases build time)
- widenClientFileUpload: true,
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
+ widenClientFileUpload: true,
- // Transpiles SDK to be compatible with IE11 (increases bundle size)
- transpileClientSDK: true,
+ // Transpiles SDK to be compatible with IE11 (increases bundle size)
+ transpileClientSDK: true,
- // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
- tunnelRoute: '/monitoring',
+ // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
+ tunnelRoute: '/monitoring',
- // Hides source maps from generated client bundles
- hideSourceMaps: true,
+ // Hides source maps from generated client bundles
+ hideSourceMaps: true,
- // Automatically tree-shake Sentry logger statements to reduce bundle size
- disableLogger: true,
- },
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
+ disableLogger: true,
+ },
+ ),
+ millionConfig,
);
diff --git a/apps/web/package.json b/apps/web/package.json
index b7cd26c7..cbd4be9e 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -44,6 +44,7 @@
"framer-motion": "^10.12.22",
"lodash": "^4.17.21",
"lz-string": "^1.5.0",
+ "million": "2.6.0-beta.12",
"monaco-vim": "^0.4.0",
"next": "^13.4.19",
"next-themes": "^0.2.1",
diff --git a/packages/monaco/src/split-editor.tsx b/packages/monaco/src/split-editor.tsx
index c3fa573c..84f289d5 100644
--- a/packages/monaco/src/split-editor.tsx
+++ b/packages/monaco/src/split-editor.tsx
@@ -29,6 +29,7 @@ export interface SplitEditorProps {
monaco: typeof import('monaco-editor') | undefined;
}
+// million-ignore
export default function SplitEditor({
className,
tests,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8d4634ef..f754fd29 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -70,9 +70,12 @@ importers:
clsx:
specifier: ^2.0.0
version: 2.0.0
+ million:
+ specifier: 2.6.0-beta.12
+ version: 2.6.0-beta.12
next:
specifier: 13.4.19
next-auth:
specifier: ^4.22.1
version: 4.22.1(patch_hash=mr6pbhgbmy4dt4xo4hxm5k4ym4)([email protected])([email protected])([email protected])
@@ -166,7 +169,7 @@ importers:
version: 1.0.0
next:
specifier: ^13.4.8
react:
specifier: latest
version: 18.2.0
@@ -282,12 +285,15 @@ importers:
lz-string:
specifier: ^1.5.0
version: 1.5.0
+ million:
+ specifier: 2.6.0-beta.12
+ version: 2.6.0-beta.12
monaco-vim:
specifier: ^0.4.0
version: 0.4.0(patch_hash=j3oqxjoadtct3pc6tokddngzsm)
next:
specifier: ^13.4.19
next-themes:
specifier: ^0.2.1
@@ -524,7 +530,7 @@ importers:
version: 0.4.0(patch_hash=j3oqxjoadtct3pc6tokddngzsm)
next:
specifier: ^13.4.10
next-themes:
specifier: ^0.2.1
@@ -876,6 +882,11 @@ packages:
'@babel/helper-validator-identifier': 7.22.5
dev: false
+ resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==}
engines: {node: '>=6.9.0'}
@@ -933,6 +944,26 @@ packages:
'@babel/types': 7.22.10
dev: false
+ resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.10
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: false
+
+ resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.22.10
+ '@babel/helper-plugin-utils': 7.22.5
+ dev: false
+
resolution: {integrity: sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==}
engines: {node: '>=6.9.0'}
@@ -3665,7 +3696,7 @@ packages:
'@sentry/utils': 7.66.0
'@sentry/webpack-plugin': 1.20.0
chalk: 3.0.0
react: 18.2.0
rollup: 2.78.0
stacktrace-parser: 0.1.10
@@ -4421,7 +4452,7 @@ packages:
execa: 5.1.1
find-up: 5.0.0
get-port: 5.1.1
dev: false
patched: true
@@ -8156,6 +8187,21 @@ packages:
braces: 3.0.2
picomatch: 2.3.1
+ resolution: {integrity: sha512-ps7oiPYgl2rlmFSdNKvhcfCxaRHTfueUYEjdzOxWcvRuF/jO+ngL4gq1P6+CamG3CLCRXdcPRgHZ9IQHAkI31A==}
+ dependencies:
+ '@babel/core': 7.22.10
+ '@babel/generator': 7.22.10
+ '@babel/plugin-syntax-jsx': 7.22.5(@babel/[email protected])
+ '@babel/plugin-syntax-typescript': 7.22.5(@babel/[email protected])
+ '@babel/types': 7.22.10
+ kleur: 4.1.5
+ rollup: 3.28.1
+ unplugin: 1.4.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
@@ -8276,7 +8322,7 @@ packages:
'@panva/hkdf': 1.1.1
cookie: 0.5.0
jose: 4.14.4
oauth: 0.9.15
openid-client: 5.4.3
preact: 10.16.0
@@ -8294,12 +8340,12 @@ packages:
react: '*'
react-dom: '*'
dependencies:
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false
resolution: {integrity: sha512-HuPSzzAbJ1T4BD8e0bs6B9C1kWQ6gv8ykZoRWs5AQoiIuqbGHHdQO7Ljuvg05Q0Z24E2ABozHe6FxDvI6HfyAw==}
engines: {node: '>=16.8.0'}
hasBin: true
@@ -8321,7 +8367,7 @@ packages:
postcss: 8.4.14
react: 18.2.0
react-dom: 18.2.0([email protected])
- styled-jsx: 5.1.1([email protected])
+ styled-jsx: 5.1.1(@babel/[email protected])([email protected])
watchpack: 2.4.0
zod: 3.21.4
optionalDependencies:
@@ -9651,6 +9697,14 @@ packages:
fsevents: 2.3.2
dev: true
+ resolution: {integrity: sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==}
+ engines: {node: '>=14.18.0', npm: '>=8.0.0'}
+ hasBin: true
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: false
+
resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==}
engines: {node: '>=12'}
@@ -10001,7 +10055,7 @@ packages:
inline-style-parser: 0.1.1
dev: false
resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}
engines: {node: '>= 12.0.0'}
peerDependencies:
@@ -10014,6 +10068,7 @@ packages:
babel-plugin-macros:
optional: true
dependencies:
+ '@babel/core': 7.22.10
client-only: 0.0.1
react: 18.2.0
dev: false
@@ -10562,6 +10617,15 @@ packages:
engines: {node: '>= 10.0.0'}
dev: false
+ resolution: {integrity: sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==}
+ dependencies:
+ acorn: 8.10.0
+ chokidar: 3.5.3
+ webpack-sources: 3.2.3
+ webpack-virtual-modules: 0.5.0
+ dev: false
+
resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==}
engines: {node: '>=8'}
@@ -10762,6 +10826,10 @@ packages:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
engines: {node: '>=10.13.0'}
+ resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}
+ dev: false
+
resolution: {integrity: sha512-FROX3TxQnC/ox4N+3xQoWZzvGXSuscxR32rbzjpXgEzWudJFEJBpdlkkob2ylrv5yzzufD1zph1OoFsLtm6stQ==}
engines: {node: '>=10.13.0'}