Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[design-system]: update to 1.3.0 #14925

Merged
merged 8 commits into from Nov 18, 2022
Merged

[design-system]: update to 1.3.0 #14925

merged 8 commits into from Nov 18, 2022

Conversation

joshuaellis
Copy link
Member

@joshuaellis joshuaellis commented Nov 18, 2022

What does it do?

  • Updates the design-system dependencies
  • Updates snapshots
  • Updates imports to use the root (because tree shaking & module federation is now a thing)
  • Use find-root package to find the roots of node_modules in the alias (see next paragraph for why)

Why is it needed?

Originally we applied the fix of require.resolve(${moduleName}/package.json) which implicitly uses the node resolution methods therefore using the exports property of a package.json. Therefore where someone has used a conditional submodule:

{
	"exports": {
		"/*": "/dist/*"
	}
}

the resolution will fail because the file may not be there therefore I've opted to use findRoot where you can just pass the defacto CJS export of any module and it will find the root.

Note

If you're going to locally test it you'll want to run something like yarn lerna clean && rm -rf node_modules && yarn setup to clean the entire repo and start from scratch to avoid any deps caches.

@joshuaellis joshuaellis added source: dependencies Source is dependency problem pr: chore This PR contains chore tasks (cleanups, configs, tooling...) labels Nov 18, 2022
@joshuaellis joshuaellis self-assigned this Nov 18, 2022
@@ -40,7 +41,7 @@ const aliasExactMatch = [
// See https://webpack.js.org/configuration/resolve/
module.exports = {
...aliasExactMatch.reduce((acc, moduleName) => {
acc[`${moduleName}$`] = path.dirname(require.resolve(`${moduleName}/package.json`));
acc[`${moduleName}$`] = findRoot(require.resolve(moduleName));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the alias change i talk about in the PR description.

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Base: 59.62% // Head: 59.62% // No change to project coverage 👍

Coverage data is based on head (6c8dcaa) compared to base (7edfefc).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14925   +/-   ##
=======================================
  Coverage   59.62%   59.62%           
=======================================
  Files        1339     1339           
  Lines       32566    32566           
  Branches     6207     6207           
=======================================
  Hits        19418    19418           
  Misses      11289    11289           
  Partials     1859     1859           
Flag Coverage Δ
front 64.09% <ø> (ø)
unit 49.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gins/i18n/admin/src/components/LocaleList/index.js 0.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me ✨

@joshuaellis joshuaellis merged commit abb4faf into main Nov 18, 2022
@joshuaellis joshuaellis deleted the chore/ds-130 branch November 18, 2022 13:27
@joshuaellis joshuaellis added this to the 4.5.2 milestone Nov 18, 2022
@jcAtRsi
Copy link

jcAtRsi commented Dec 2, 2022

I think something may have happened after this merge. When a plugin is importing icons or any of the design-system/v2 items (such as Pagination), build errors are generated. In the prior version (4.5.1), imports were fine. More info here: https://discord.com/channels/811989166782021633/1048343064143478794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: dependencies Source is dependency problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants