diff --git a/package.json b/package.json index 03f512ae2b7..3526e7ba752 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@artsy/backbone-mixins": "3.0.0", "@artsy/cohesion": "4.51.0", "@artsy/eigen-web-association": "1.5.1", - "@artsy/express-reloadable": "1.6.0", + "@artsy/express-reloadable": "^1.7.0", "@artsy/fresnel": "3.5.0", "@artsy/gemup": "0.1.0", "@artsy/multienv": "^1.2.0", @@ -398,6 +398,7 @@ "stylus-loader": "3.0.2", "supertest": "2.0.1", "terser-webpack-plugin": "5.1.3", + "time-fix-plugin": "^2.0.7", "typescript": "4.7.2", "typescript-styled-plugin": "0.15.0", "vscode-apollo-relay": "1.5.2", diff --git a/src/dev.js b/src/dev.js index 16b5bf11fc1..e4c455193af 100644 --- a/src/dev.js +++ b/src/dev.js @@ -107,13 +107,7 @@ mountAndReload(path.resolve("src/v2/server.ts"), { // Mount express-reloadable on legacy routes mountAndReload(path.resolve("src/desktop"), { - watchModules: [ - path.resolve(process.cwd(), "src/v2"), - "@artsy/cohesion", - "@artsy/fresnel", - "@artsy/palette", - "@artsy/stitch", - ], + watchModules: ["@artsy/palette"], }) // Start server diff --git a/src/v2/Apps/Home/HomeApp.tsx b/src/v2/Apps/Home/HomeApp.tsx index c4469ff291b..3eabdefb74a 100644 --- a/src/v2/Apps/Home/HomeApp.tsx +++ b/src/v2/Apps/Home/HomeApp.tsx @@ -26,7 +26,6 @@ export const HomeApp: React.FC = ({ homePage, featuredEventsOrderedSet, }) => { - console.log("hi") return ( <> diff --git a/webpack/envs/clientDevelopmentConfig.js b/webpack/envs/clientDevelopmentConfig.js index 08131bc13ea..cdc02515136 100644 --- a/webpack/envs/clientDevelopmentConfig.js +++ b/webpack/envs/clientDevelopmentConfig.js @@ -4,6 +4,7 @@ import HtmlWebpackPlugin from "html-webpack-plugin" import LoadablePlugin from "@loadable/webpack-plugin" import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin" import SimpleProgressWebpackPlugin from "simple-progress-webpack-plugin" +import TimeFixPlugin from "time-fix-plugin" import { WebpackManifestPlugin } from "webpack-manifest-plugin" import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin" import path from "path" @@ -51,11 +52,18 @@ export const clientDevelopmentConfig = () => ({ concatenateModules: env.webpackConcatenate, runtimeChunk: "single", // Extract webpack runtime code into it's own file splitChunks, + + // Webpack does extra algorithmic work to optimize the output for size and + // load performance. These optimizations are performant for smaller codebases, + // but can be costly in larger ones. + removeAvailableModules: env.isDevelopment, + removeEmptyChunks: env.isDevelopment, }, output: { filename: "[name].js", path: path.resolve(basePath, "public/assets"), publicPath: "/assets/", + pathinfo: false, }, plugins: [ ...sharedPlugins(), @@ -84,6 +92,7 @@ export const clientDevelopmentConfig = () => ({ new SimpleProgressWebpackPlugin({ format: "minimal", }), + new TimeFixPlugin(), new WebpackManifestPlugin({ basePath: "/assets/", fileName: path.resolve(basePath, "manifest-novo.json"), diff --git a/webpack/envs/splitChunks.js b/webpack/envs/splitChunks.js index c82829e8ea5..7f5fa9203d9 100644 --- a/webpack/envs/splitChunks.js +++ b/webpack/envs/splitChunks.js @@ -6,8 +6,8 @@ const FRAMEWORK_BUNDLES = ["react", "react-dom", "@sentry"] const TOTAL_PAGES = 12 export const splitChunks = { - chunks: "all", automaticNameDelimiter: "-", + chunks: "all", cacheGroups: { default: false, defaultVendors: false, diff --git a/webpack/utils/env.js b/webpack/utils/env.js index eef91d2003d..a3125dd7d5d 100644 --- a/webpack/utils/env.js +++ b/webpack/utils/env.js @@ -64,6 +64,7 @@ if (env.onCi || env.logConfig) { console.log(" BUILD_SERVER".padEnd(35), chalk.yellow(env.buildServer)) console.log(" BUILD_CLIENT".padEnd(35), chalk.yellow(env.buildClient)) console.log(" CI".padEnd(35), chalk.yellow(env.onCi)) + console.log(" COMPILE_LEGACY_CLIENT_IN_DEV".padEnd(35), chalk.yellow(env.compileLegacyClientInDev)) console.log(" NODE_ENV == 'isDevelopment'".padEnd(35), chalk.yellow(env.isDevelopment)) console.log(" NODE_ENV == 'isProduction'".padEnd(35), chalk.yellow(env.isProduction)) console.log(" NODE_ENV == 'isStaging'".padEnd(35), chalk.yellow(env.isStaging)) diff --git a/yarn.lock b/yarn.lock index f40c142dc94..232f3a0f9c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -51,10 +51,10 @@ dependencies: express "^4.15.0" -"@artsy/express-reloadable@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@artsy/express-reloadable/-/express-reloadable-1.6.0.tgz#5660febfa07d4c7ea5a838878ae61b906fd10c0d" - integrity sha512-UVUn6s1D38mO1s711JPkvG1uy0fkVy504TpLnl745hbF2TtACv/I52hwFv1xISGdyz8rvQreYYHcXjkZvzmsnw== +"@artsy/express-reloadable@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@artsy/express-reloadable/-/express-reloadable-1.7.0.tgz#af8f93aea5ad8cf6ebb90d9be484c3e19269ffb6" + integrity sha512-a8PQ6NGjSP+T7S/Ll4Z53SUdqG7K1QGg4jr5gnjClEKRQWAmr2HLxu0Dr+XLtYjYwJbqUtQg48WtJrf49OPaZw== dependencies: chalk "^2.3.1" chokidar "^3.0.0" @@ -21342,6 +21342,11 @@ through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +time-fix-plugin@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/time-fix-plugin/-/time-fix-plugin-2.0.7.tgz#4ba70ae2e40cedf34dabe505eda7b71b1b244f50" + integrity sha512-uVFet1LQToeUX0rTcSiYVYVoGuBpc8gP/2jnlUzuHMHe+gux6XLsNzxLUweabMwiUj5ejhoIMsUI55nVSEa/Vw== + timed-out@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"