Skip to content

Commit

Permalink
[core] Fix webpack capitalization (#44352)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Nov 11, 2024
1 parent 710cd95 commit 3d21338
Show file tree
Hide file tree
Showing 32 changed files with 51 additions and 50 deletions.
28 changes: 14 additions & 14 deletions CHANGELOG.old.md
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,7 @@ A big thanks to the 21 contributors who made this release possible. Here are som
### Core

- [changelog] Fix issues in highlight @oliviertassinari
- [core] Remove redundant `@material-ui/` aliases from regression test Webpack config (#38574) @ZeeshanTamboli
- [core] Remove redundant `@material-ui/` aliases from regression test webpack config (#38574) @ZeeshanTamboli
- [core] Fix CI error @oliviertassinari
- [core] Remove unnecessary Box (#38461) @oliviertassinari
- [core] Set GitHub Action top level permission @oliviertassinari
Expand Down Expand Up @@ -5458,7 +5458,7 @@ A big thanks to the 21 contributors who made this release possible. Here are som
- [docs] Fix typo in `Grid` docs (#34475) @Dustin-Digitar
- [docs] Fix typo in `Back to top` section in AppBar docs (#34479) @Dustin-Digitar
- [docs] Standardize all "Installation" pages (#34168) @samuelsycamore
- [docs] Fix Webpack file name to the standard: `webpack.config.js` (#34446) @CodingItWrong
- [docs] Fix webpack file name to the standard: `webpack.config.js` (#34446) @CodingItWrong
- [docs] Fix Select `onChange` call (#34408) @siriwatknp
- [docs] Notification for pickers blog - v5 stable (#34400) @joserodolfofreitas
- [docs] Improve social sharing of docs pages (#34346) @oliviertassinari
Expand Down Expand Up @@ -6103,7 +6103,7 @@ A big thanks to the 19 contributors who made this release possible. Here are som
- [docs] Update to React 18 (#33196) @mnajdova
- [docs] Simplify "Upload button" demo (#33326) @baharalidurrani
- [docs] Add "refine" demo to showcase (#33240) @omeraplak
- [docs] Add Webpack alias for legacy utils package (#33376) @jgbae
- [docs] Add webpack alias for legacy utils package (#33376) @jgbae
- [docs] Improve external link icons synonyms (#33257) @davidgarciab
- [examples] Update Base UI with Tailwind CSS to use the latest versions of the dependencies (#33401) @mnajdova
- [examples] Add Base UI example (#33154) @siriwatknp
Expand Down Expand Up @@ -8762,7 +8762,7 @@ A big thanks to the 14 contributors who made this release possible. Here are som
- [core] Remove code handling JSS components (#28421) @eps1lon
- [core] Remove unused dependencies (#28468) @eps1lon
- [core] Ensure both docs bundles are analyzeable (#28410) @eps1lon
- [core] Switch to Webpack 5 (#28248) @eps1lon
- [core] Switch to webpack 5 (#28248) @eps1lon
- [core] Batch small changes (#28177) @oliviertassinari
- [core] Update publish tag to latest (#28382) @mnajdova
- [framer] Update @mui/\* dependencies (#28469) @eps1lon
Expand Down Expand Up @@ -9483,7 +9483,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som
- [docs] Sort the size in a more logical order (#27186) @oliviertassinari
- [docs] Use actual link to paperbase (#27063) @eps1lon
- [docs] Use custom markdown loader for landing page (#27065) @eps1lon
- [docs] Use Webpack 5 (#27077) @eps1lon
- [docs] Use webpack 5 (#27077) @eps1lon
- [examples] Fix CDN warning (#27229) @oliviertassinari
- [examples] Remove `StyledEngineProvider` as JSS is not used (#27133) @mnajdova
- [examples] Remove forgotten StyledEngineProvider (#27163) @oliviertassinari
Expand Down Expand Up @@ -9612,7 +9612,7 @@ A big thanks to the 13 contributors who made this release possible. Here are som
- [docs] Fix /components/hidden merge conflict (#26997) @eps1lon
- [docs] Fix 404 links (#26963) @oliviertassinari
- [docs] Remove link that points to v4 blog post (#26960) @steveafrost
- [docs] Use custom Webpack loader for markdown (#26774) @eps1lon
- [docs] Use custom webpack loader for markdown (#26774) @eps1lon
- [docs] Fix 301 links (#26942) @oliviertassinari
- [docs] Add page for the `sx` prop (#26769) @mnajdova
- [docs] pre-fill issue when a demo crashes (#27034) @eps1lon
Expand Down Expand Up @@ -15660,7 +15660,7 @@ A big thanks to the 25 contributors who made this release possible.
- [docs] Improve a11y of the chip array example (#20294) @m4theushw
- [docs] Refactor markdown parsing (#20549) @eps1lon
- [docs] Remove old workarounds (#20587) @eps1lon
- [docs] Remove unnecessary Webpack loaders (#20563) @eps1lon
- [docs] Remove unnecessary webpack loaders (#20563) @eps1lon
- [docs] Sync translations (#20498) @oliviertassinari
- [docs] Use reactStrictMode over custom switch (#20522) @eps1lon

Expand Down Expand Up @@ -22224,7 +22224,7 @@ A big thanks to the 14 contributors who made this release possible.
- [RaisedButton] Conditionally apply overlay backgroundColor (#9811) @walwoodr
- [Snackbar] Static properties for reason string constants (#10300) @RavenHursT
- [TextField] Fix caret position issue (#10214) @MaratFaskhiev
- Add sideEffects: false for Webpack 4 (#11167) @matthoffner
- Add sideEffects: false for webpack 4 (#11167) @matthoffner

### Docs

Expand Down Expand Up @@ -25082,7 +25082,7 @@ When `withStyles()` is used as a decorator and `strictNullChecks` is enabled, on
- [types] Better component typing (#8304) @oliviertassinari
- [styles] Add a new defensive warning (#8341) @oliviertassinari
- [core] Upgrade the dependencies (#8284) @oliviertassinari
- [core] Help Webpack doing dead code elimination (#8340) @oliviertassinari
- [core] Help webpack doing dead code elimination (#8340) @oliviertassinari
- [core] Add TypeScript in the CI (#8328) @oliviertassinari
- [typescript] Fix typo in Tooltip (#8271) @Rid
- [typescript] Fix definitions for BreakpointsOptions (#8285) @peterprice
Expand Down Expand Up @@ -25802,7 +25802,7 @@ We do, we have extended the support of React to the 16.0.0-alpha.13 release (aka
- [docs] Fix typo in class name (#7192) @ossan-engineer
- [docs] Add supported server section (#7231) @oliviertassinari
- [docs] Detail the browser support (#7188) @oliviertassinari
- [docs] Upgrade to Webpack v3 (#7210) @oliviertassinari
- [docs] Upgrade to webpack v3 (#7210) @oliviertassinari
- [docs] More documentation on the typography (#7248) @oliviertassinari

### Core
Expand Down Expand Up @@ -26381,7 +26381,7 @@ _Feb 26, 2017_

### Docs

- [docs] Use Webpack 2 & dll bundle (#6160) @nathanmarks
- [docs] Use webpack 2 & dll bundle (#6160) @nathanmarks
- [docs] Improve the user experience on mobile (#6154) @oliviertassinari
- [docs] Fix the Table examples on mobile (425d8ed47e0282b8c0409517c53e00ef61374b02) @oliviertassinari
- [docs] Add an API section (#6239) @oliviertassinari
Expand All @@ -26391,7 +26391,7 @@ _Feb 26, 2017_

- [core] Fix typos in styles/transitions pointed out in issue (#6175) @Shahrukh-Zindani
- [core] Lightweight the build (#6152) @oliviertassinari
- [core] Add exports to index.js for inclusion in Webpack bundle (#6144) @fkretzer
- [core] Add exports to index.js for inclusion in webpack bundle (#6144) @fkretzer
- [test] Integration of test suite to run on BrowserStack (#6236) @oliviertassinari
- [test] Bump vrtest version for exit code fix (1831aa76fe72e9b22a0b82f2a360f860ca89fdce) @nathanmarks

Expand Down Expand Up @@ -26535,7 +26535,7 @@ You can preview a **very early** version of the `next` branch following [this li

### Core

- [core] Add support for Webpack 2/Rollup tree shaking in `svg-icons` sub module (#5774)
- [core] Add support for webpack 2/Rollup tree shaking in `svg-icons` sub module (#5774)

## 0.16.5

Expand Down Expand Up @@ -26595,7 +26595,7 @@ This release is intended to solve an [issue](https://github.com/mui/material-ui/

- [ListItem] Fix hover on touch devices (#5566)
- [core] include `react-tap-event-plugin@^2.0.0` for `react@^15.4.0` (#5572)
- [core] Add support for Webpack 2/Rollup tree shaking (#5545)
- [core] Add support for webpack 2/Rollup tree shaking (#5545)

### Docs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ npm install @mui/icons-material @mui/material

Because `@mui/material` is a required dependency of `@mui/icons-material`, you have to update your bundler's config to add an alias.

Here is an example of how you can do it, if you use [Webpack](https://webpack.js.org/):
Here is an example of how you can do it, if you use [webpack](https://webpack.js.org/):

**webpack.config.js**

Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/icons/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ This component extends the native `<svg>` element:
### Component prop

You can use the `SvgIcon` wrapper even if your icons are saved in the `.svg` format.
[svgr](https://github.com/gregberge/svgr) has loaders to import SVG files and use them as React components. For example, with Webpack:
[svgr](https://github.com/gregberge/svgr) has loaders to import SVG files and use them as React components. For example, with webpack:

```jsx
// webpack.config.js
Expand Down
8 changes: 4 additions & 4 deletions docs/data/material/getting-started/faq/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ There are several common reasons for this to happen:

- You have another `@mui/styles` library somewhere in your dependencies.
- You have a monorepo structure for your project (for example, lerna or yarn workspaces) and `@mui/styles` module is a dependency in more than one package (this one is more or less the same as the previous one).
- You have several applications that are using `@mui/styles` running on the same page (for example, several entry points in Webpack are loaded on the same page).
- You have several applications that are using `@mui/styles` running on the same page (for example, several entry points in webpack are loaded on the same page).

### Duplicated module in node_modules

Expand All @@ -365,7 +365,7 @@ If you identified that duplication is the issue that you are encountering there
If you are using npm you can try running `npm dedupe`.
This command searches the local dependencies and tries to simplify the structure by moving common dependencies further up the tree.

If you are using Webpack, you can change the way it will [resolve](https://webpack.js.org/configuration/resolve/#resolve-modules) the @mui/styles module. You can overwrite the default order in which Webpack will look for your dependencies and make your application node_modules more prioritized than default node module resolution order:
If you are using webpack, you can change the way it will [resolve](https://webpack.js.org/configuration/resolve/#resolve-modules) the @mui/styles module. You can overwrite the default order in which webpack will look for your dependencies and make your application node_modules more prioritized than default node module resolution order:

```diff
resolve: {
Expand All @@ -377,7 +377,7 @@ If you are using Webpack, you can change the way it will [resolve](https://webpa

### Running multiple applications on one page

If you have several applications running on one page, consider using one @mui/styles module for all of them. If you are using Webpack, you can use [CommonsChunkPlugin](https://webpack.js.org/plugins/commons-chunk-plugin/) to create an explicit [vendor chunk](https://webpack.js.org/plugins/commons-chunk-plugin/#explicit-vendor-chunk), that will contain the @mui/styles module:
If you have several applications running on one page, consider using one @mui/styles module for all of them. If you are using webpack, you can use [CommonsChunkPlugin](https://webpack.js.org/plugins/commons-chunk-plugin/) to create an explicit [vendor chunk](https://webpack.js.org/plugins/commons-chunk-plugin/#explicit-vendor-chunk), that will contain the @mui/styles module:

```diff
module.exports = {
Expand Down Expand Up @@ -409,7 +409,7 @@ You could end up accidentally using two class name generators in a variety of sc
- You are using a bundler and it is splitting code in a way that causes multiple class name generator instances to be created.

:::success
If you are using Webpack with the [SplitChunksPlugin](https://webpack.js.org/plugins/split-chunks-plugin/), try configuring the [`runtimeChunk` setting under `optimizations`](https://webpack.js.org/configuration/optimization/#optimization-runtimechunk).
If you are using webpack with the [SplitChunksPlugin](https://webpack.js.org/plugins/split-chunks-plugin/), try configuring the [`runtimeChunk` setting under `optimizations`](https://webpack.js.org/configuration/optimization/#optimization-runtimechunk).
:::

Overall, it's simple to recover from this problem by wrapping each Material UI application with [`StylesProvider`](/system/styles/api/#stylesprovider) components at the top of their component trees **and using a single class name generator shared among them**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ Have a look at the older [versions](https://mui.com/versions/) for backward comp
Material UI requires a minimum version of TypeScript 4.7.
This aims to match the policy of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped), with the support of the versions of TypeScript that are less than two years old.

## Webpack
## webpack

The minimium required version of webpack to bundle applications that use Material UI is v5. Webpack <= v4 can't bundle Material UI untranspiled as it uses features such as the [null coalscing operator (`??`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [optional chaining (`?.`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining).
The minimium required version of webpack to bundle applications that use Material UI is v5. webpack <= v4 can't bundle Material UI untranspiled as it uses features such as the [null coalscing operator (`??`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [optional chaining (`?.`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining).
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ You are strongly discouraged to:

:::

A great way to use these bundles is to configure bundler aliases, for example with [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
A great way to use these bundles is to configure bundler aliases, for example with [webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):

```js
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ bundling solution people are using.
```jsx title="CssModulesSlider.js"
import * as React from 'react';
import Slider from '@mui/material/Slider';
// Webpack, Parcel or else will inject the CSS into the page
// webpack, Parcel or else will inject the CSS into the page
import styles from './CssModulesSlider.module.css';

export default function CssModulesSlider() {
Expand Down Expand Up @@ -504,7 +504,7 @@ The following examples override the slider's `thumb` style in addition to the cu

```jsx title="CssModulesSliderDeep1.js"
import * as React from 'react';
// Webpack, Parcel or else will inject the CSS into the page
// webpack, Parcel or else will inject the CSS into the page
import styles from './CssModulesSliderDeep1.module.css';
import Slider from '@mui/material/Slider';

Expand Down Expand Up @@ -536,7 +536,7 @@ The above demo relies on the [default `className` values](/system/styles/advance

```jsx title="CssModulesSliderDeep2.js"
import * as React from 'react';
// Webpack, Parcel or else will inject the CSS into the page
// webpack, Parcel or else will inject the CSS into the page
import styles from './CssModulesSliderDeep2.module.css';
import Slider from '@mui/material/Slider';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If you're using yarn, you can configure it using a package resolution:
### With npm

Because package resolutions aren't available with npm, you must update your bundler's config to add this alias.
The example below shows how to do this with Webpack:
The example below shows how to do this with webpack:

```diff title="webpack.config.js"
module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ In this specific example, you would need to bump the version of `@mui/x-data-gri

## Storybook and Emotion

If your project uses Storybook v6.x, you will need to update the `.storybook/main.js` Webpack config to use the most recent version of Emotion:
If your project uses Storybook v6.x, you will need to update the `.storybook/main.js` webpack config to use the most recent version of Emotion:

```js
// .storybook/main.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ It can work alongside Emotion to ease the migration process, but it is recommend

Pigment CSS can be used with one of the following frameworks:

- [Next.js App Router](https://nextjs.org/docs/app) with Webpack v5 (Turbopack is not supported yet)
- [Next.js App Router](https://nextjs.org/docs/app) with webpack v5 (Turbopack is not supported yet)
- [Vite](https://vite.dev/)

## Installation
Expand Down
Binary file modified docs/mui-vale.zip
Binary file not shown.
1 change: 1 addition & 0 deletions docs/mui-vale/styles/MUI/CorrectReferenceAllCases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ swap:
'Codesandbox ': CodeSandbox
code sandbox: CodeSandbox
Stackblitz: StackBlitz
Webpack: webpack # https://twitter.com/wSokra/status/855800490713649152
2 changes: 1 addition & 1 deletion docs/pages/blog/2020-developer-survey-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ section.

### 18. Which JavaScript framework are you using, if any?

<img src="/static/blog/2020-survey/18.png" style="width: 796px; margin-top: 16px; margin-bottom: 8px;" alt="Pie chart: 57.34% Create React App, 16.40% Custom Webpack, 12.35% Next.js, 5.40% Gatsby, 8.51% Other." />
<img src="/static/blog/2020-survey/18.png" style="width: 796px; margin-top: 16px; margin-bottom: 8px;" alt="Pie chart: 57.34% Create React App, 16.40% Custom webpack, 12.35% Next.js, 5.40% Gatsby, 8.51% Other." />

### 19. What styling system are you using?

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/blog/2021-developer-survey-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ These results are very different from last year—TypeScript took off, and it's

### Which framework are you using, if any?

<img src="/static/blog/2021-developer-survey-results/21.png" style="width: 796px; margin-top: 16px; margin-bottom: 8px;" alt="Create React App: 62.4%; Next.js: 21.9%; Custom Webpack: 10.7%; None: 2.6%; Gatsby: 0.9%; Other: 1.5%" />
<img src="/static/blog/2021-developer-survey-results/21.png" style="width: 796px; margin-top: 16px; margin-bottom: 8px;" alt="Create React App: 62.4%; Next.js: 21.9%; Custom webpack: 10.7%; None: 2.6%; Gatsby: 0.9%; Other: 1.5%" />

<p class="blog-description">1497 out of 1589 answered.</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/blog/material-ui-v1-is-out.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We want Material UI to become whatever is generally useful for application deve
We know the ease of use is a critical part of user acquisition. The more users we have, the more likely we can make the project sustainable. Improving the ease of use comes in different flavors:

- **Onboarding**. We have reduced the onboarding friction as much as possible. We know the onboarding is a critical step for user acquisition. The onboarding friction comes in different flavors:
We have reduced the number of installation steps needed. It should be as simple as 1. npm install @mui/material and 2. import Button from '@mui/material/Button'; . We don't ask for polyfill, custom Webpack plugin or any specific build tool. The usage of MuiThemeProvider is no longer mandatory.
We have reduced the number of installation steps needed. It should be as simple as 1. npm install @mui/material and 2. import Button from '@mui/material/Button'; . We don't ask for polyfill, custom webpack plugin or any specific build tool. The usage of MuiThemeProvider is no longer mandatory.

- **Examples**. We are hosting [example projects](https://github.com/mui/material-ui/tree/master/examples) with the most popular solutions to start a project: [create-react-app](https://github.com/facebook/create-react-app), [Next.js](https://github.com/vercel/next.js), [Gatsby](https://github.com/gatsbyjs/gatsby), and CDN.

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/blog/mui-x-v7-beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ While string values remain compatible for these types, any updates to the `filte

### Smaller bundle size

The introduction of a separate entry point for locales has significantly reduced the bundle size of the barrel index when tree-shaking isn't operational (for example Webpack in dev mode).
The introduction of a separate entry point for locales has significantly reduced the bundle size of the barrel index when tree-shaking isn't operational (for example webpack in dev mode).

For example with the `@mui/x-data-grid` npm package, this change led to a reduction of approximately 22% – shrinking the bundle size from [114.2kB](https://bundlephobia.com/package/@mui/[email protected]) to [88.5kB](https://bundlephobia.com/package/@mui/[email protected]).

Expand Down
Loading

0 comments on commit 3d21338

Please sign in to comment.