diff --git a/v3-docs/docs/about/modern-build-stack.md b/v3-docs/docs/about/modern-build-stack.md index 7c5d0bc9ce..1f3db4507d 100644 --- a/v3-docs/docs/about/modern-build-stack.md +++ b/v3-docs/docs/about/modern-build-stack.md @@ -10,7 +10,7 @@ To improve the development and deployment experience for all Meteor projects, we - **Modern Transpiler**: Meteor is adopting **SWC** as a faster alternative to Babel. - **Modern Bundler**: A new bundler will handle only your app’s code, supporting tree-shaking, popular plugins, and better features for both development and production. Meanwhile, Meteor’s core bundler will continue handling Meteor-specific tasks, such as compiling Atmosphere packages, with optimized workflows. -- **Dev Server Enhancements**: The dev server remains a core part of Meteor, now with ongoing improvements in performance and developer features. +- **Modern Dev Server**: The dev server remains a core part of Meteor, now with ongoing improvements in performance and developer features. A new bundler will complement the dev server, providing additional enhancements. ## Quick start @@ -22,4 +22,10 @@ Start using the new build stack by creating a Meteor app, or add this to your `p } ``` -Learn more about these settings in the [Modern Transpiler](modern-build-stack/modern-transpiler-swc.md) and [Modern Bundler](modern-build-stack/modern-bundler.md) guides. +With this configuration, you enable all improvements from the modern build stack in your Meteor app. + +See the following sections to learn about each component and its settings: + +- [Modern Transpiler](modern-build-stack/modern-transpiler-swc.md) +- [Modern Bundler](modern-build-stack/modern-bundler.md) +- [Modern Dev Server](modern-build-stack/modern-dev-server.md) diff --git a/v3-docs/docs/about/modern-build-stack/modern-bundler.md b/v3-docs/docs/about/modern-build-stack/modern-bundler.md index c30263bf62..eefcd7b05c 100644 --- a/v3-docs/docs/about/modern-build-stack/modern-bundler.md +++ b/v3-docs/docs/about/modern-build-stack/modern-bundler.md @@ -1,16 +1,18 @@ # Modern Bundler +Meteor handles linking all project files into the final bundle. While we'd like to offload more of this to a modern bundler, we're still focused on keeping what's left in the Meteor context as fast as possible. + +Integration with a modern bundler is in progress for Meteor 3.4. Meanwhile, we've optimized existing processes for better performance. + +## Modern Web Archs + :::info Starting with Meteor 3.3 ::: -Meteor handles watching and linking all project files into the final bundle. While we'd like to offload more of this to modern bundlers, we're still focused on keeping what's left in the Meteor context as fast as possible. +> Web archs are the builds Meteor generates for modern browsers, legacy browsers, and Cordova. -Integration with a modern bundler is in progress for Meteor 3.4. Meanwhile, we've optimized existing processes for better performance. - -## Modern builds - -Starting with Meteor 3.3, new apps skip `web.browser.legacy` and `web.cordova` by default in development mode (unless developing for native). This results on getting a faster build process on development mode. +New apps skip `web.browser.legacy` and `web.cordova` by default in development mode (unless developing for native). This results on getting a faster build process on development mode. For existing apps, enable this by adding to `package.json`: @@ -22,7 +24,7 @@ For existing apps, enable this by adding to `package.json`: This works like using `--exclude-archs web.browser.legacy,web.cordova` with `meteor run`. -By default, `"modern": true` enables all build stack upgrades: new transpiler, web arch-only compilation, watcher and more. To opt out of web arch-only compilation, set `"webArchOnly": false` in your `package.json`. +By default, `"modern": true` enables all build stack upgrades. To opt out of web arch-only compilation, set `"webArchOnly": false` in your `package.json`. ```json "meteor": { @@ -32,9 +34,15 @@ By default, `"modern": true` enables all build stack upgrades: new transpiler, w } ``` -## Modern watcher +## Modern Minifier -Starting with Meteor 3.3, new apps use a modern, cross-platform watcher: [`@parcel/watcher`](https://github.com/parcel-bundler/watcher). It responds quickly to file changes using native file watching. Symbolic link changes and all traversed files are supported via polling. +:::info +Starting with Meteor 3.3 +::: + +> The minifier reduces and obfuscates your app’s production bundle for security and efficiency. + +New apps use an SWC-based minifier, replacing the legacy [Terser](https://github.com/terser/terser) minifier. This speeds up production builds and deployments. For existing apps, enable this by adding to `package.json`: @@ -44,26 +52,12 @@ For existing apps, enable this by adding to `package.json`: } ``` -If you run into issues with the new watcher, you can revert to the previous implementation for better file change detection. To disable the new watcher, set `"watcher": false` in your package.json. +By default, `"modern": true` enables all build stack upgrades. To opt out of the new minifier, set `"minifier": false` in your `package.json`. ```json "meteor": { "modern": { - "watcher": false + "minifier": false } } ``` - -The modern watcher uses the OS's native file watching with a performance-first approach. Both modern and legacy watchers support environment variables for polling, useful in edge cases like WSL with host, volumes, or remote setups. - -To enable polling, run your Meteor app with: - -```shell -# enable polling -METEOR_WATCH_FORCE_POLLING=true meteor run - -# set polling interval (in ms) -METEOR_WATCH_POLLING_INTERVAL_MS=1000 METEOR_WATCH_FORCE_POLLING=true meteor run -``` - -> Polling uses more CPU and RAM, but it's the most reliable option in some environments. diff --git a/v3-docs/docs/about/modern-build-stack/modern-dev-server.md b/v3-docs/docs/about/modern-build-stack/modern-dev-server.md new file mode 100644 index 0000000000..95e272f200 --- /dev/null +++ b/v3-docs/docs/about/modern-build-stack/modern-dev-server.md @@ -0,0 +1,47 @@ +# Modern Dev Server + +Meteor Dev Server provides real-time file watching during development, with fast feedback through HMR, bundle visualizers, debug tools, Mongo built-in instance, CLI tools and more. At runtime, it offers a complete server environment supporting SSR and modern Express-based APIs. + +As part of the modern build stack, we update each component for improved performance, smarter tooling, and better bundle observability and debugging. While Meteor Dev Server remains at the core, we’ll integrate modern tools and a new bundler to enhance your app development. + +## Modern Watcher + +:::info +Starting with Meteor 3.3 +::: + +> The watcher listens for changes in your app’s code files and triggers quick recompilations. + +New apps use a modern, cross-platform watcher: [`@parcel/watcher`](https://github.com/parcel-bundler/watcher). It responds quickly to file changes using native file watching. Symbolic link changes and all traversed files are supported via polling. + +For existing apps, enable this by adding to `package.json`: + +```json +"meteor": { + "modern": true +} +``` + +If you run into issues with the new watcher, you can revert to the previous implementation for better file change detection. To disable the new watcher, set `"watcher": false` in your package.json. + +```json +"meteor": { + "modern": { + "watcher": false + } +} +``` + +The modern watcher uses the OS's native file watching with a performance-first approach. Both modern and legacy watchers support environment variables for polling, useful in edge cases like WSL with host, volumes, or remote setups. + +To enable polling, run your Meteor app with: + +```shell +# enable polling +METEOR_WATCH_FORCE_POLLING=true meteor run + +# set polling interval (in ms) +METEOR_WATCH_POLLING_INTERVAL_MS=1000 METEOR_WATCH_FORCE_POLLING=true meteor run +``` + +> Polling uses more CPU and RAM, but it's the most reliable option in some environments. diff --git a/v3-docs/docs/about/modern-build-stack/modern-transpiler-swc.md b/v3-docs/docs/about/modern-build-stack/modern-transpiler-swc.md index b800f99b74..2d15e43105 100644 --- a/v3-docs/docs/about/modern-build-stack/modern-transpiler-swc.md +++ b/v3-docs/docs/about/modern-build-stack/modern-transpiler-swc.md @@ -4,6 +4,8 @@ Starting with Meteor 3.3 ::: +> The transpiler converts modern JS syntax in all app code to a cross-browser compatible version. + Meteor has long used Babel, a mature and still widely adopted transpiler. However, it lags behind newer tools like SWC in terms of speed. SWC and others are not only faster but are growing in use and features, reaching parity with Babel. Since transpilation is one of the slowest steps in development, Meteor now gives you the option to use SWC for your apps. @@ -20,7 +22,7 @@ Add this to your app's `package.json`: When starting your app for web or native, SWC will handle all files: your app, npm packages, and Atmosphere packages. This also applies to production builds. -By default, `"modern": true` enables all build stack upgrades: new transpiler, web arch-only compilation, watcher and more. To opt out of SWC, set `"transpiler": false` in your `package.json`. +By default, `"modern": true` enables all build stack upgrades. To opt out of SWC transpiler, set `"transpiler": false` in your `package.json`. ```json "meteor": {