mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[core] Remove outdated dependency

Open oliviertassinari opened this issue 3 years ago • 1 comments

In the future, we should look into how we can have the docs-infra control it's own npm dependencies so https://github.com/mui/material-ui/pull/34421 is enough.

oliviertassinari avatar Sep 21 '22 17:09 oliviertassinari

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 476.8 727.2 605.8 597.76 106.592
Sort 100k rows ms 516.9 919.3 777.7 743.4 137.277
Select 100k rows ms 157 265.1 214.7 217.26 37.517
Deselect 100k rows ms 110.6 206.4 159.7 161.26 30.793

Generated by :no_entry_sign: dangerJS against 079371b339fc7afbf6a04295d5e8fd587e6c4ec7

mui-bot avatar Sep 21 '22 18:09 mui-bot

image

It seems like it has removed some used dependencies as a side effect

flaviendelangle avatar Sep 22 '22 06:09 flaviendelangle

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Sep 22 '22 07:09 github-actions[bot]

Wow, so strange, why would remove npm dependencies changes how webpack match aliases?

As far as I could push the exploration, the issue is that

const requireDocs = require.context('docsx/data', true, /js$/);

Gets converted by webpack alias. As far as I know https://github.com/tleunen/babel-plugin-module-resolver isn't reading require.context. So it turns into:

const requireDocs = require.context('./docs/data', true, /js$/);

Which is then turned by the second alias to:

const requireDocs = require.context('./node_modules/@mui/monorepo/docs/data', true, /js$/);

Where it fails. The fix I'm proposing is to have webpack also try to resolve with:

const requireDocs = require.context('./docs/data', true, /js$/);

oliviertassinari avatar Sep 22 '22 10:09 oliviertassinari

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 06 '22 13:10 github-actions[bot]

It would be nice to push this PR forward as it will resolve a critical dependabot alert

LukasTy avatar Oct 07 '22 07:10 LukasTy

The webpack fail is indeed weird I have no idea if the fix proposed risk to break something else. It seems weird to have an alias target to totally different folders, one being the target of another alias. But if @oliviertassinari is confident enough.

flaviendelangle avatar Oct 07 '22 07:10 flaviendelangle

I have updated the approach, see if you are happy with it.

oliviertassinari avatar Oct 08 '22 20:10 oliviertassinari

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 10 '22 07:10 github-actions[bot]

The impact of the fix is now a lot more scoped than in the first attempt, I have made the configuration closer to the one used in https://github.com/mui/material-ui/. Since it's not really important to get peer feedback on this, and it has been pending for a week or two, I'm moving forward 😁

oliviertassinari avatar Oct 14 '22 21:10 oliviertassinari