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

Update mdc_web then roll those updates into DartPad #2388

Closed
parlough opened this issue Oct 10, 2022 · 6 comments
Closed

Update mdc_web then roll those updates into DartPad #2388

parlough opened this issue Oct 10, 2022 · 6 comments
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-tech-debt

Comments

@parlough
Copy link
Member

parlough commented Oct 10, 2022

We currently have to override the sass dependency due to a previous issue with Material Components Web which the fix for has not yet rolled into package:mdc_web. Due to changes in modern sass versions, we also have to restrict sass_builder to an old version.

We should incorporate the new changes into package:mdc_web, then update the packages here and remove the necessary overrides.

@parlough parlough added P2 A bug or feature request we're likely to work on type-tech-debt labels Oct 10, 2022
@parlough
Copy link
Member Author

parlough commented Nov 16, 2022

@johnpryan Looks like holding back sass is going to start causing problems (https://github.com/dart-lang/dart-pad/actions/runs/3481346651/jobs/5822319108). I'm not familiar with the process of updating mdc_web or what is required there. Could you provide some context on how to do so or update it when you get a chance?

@parlough parlough added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on labels Nov 16, 2022
@johnpryan
Copy link
Contributor

There's a script to automatically update the SASS in mdc_web: https://github.com/jifalops/mdc_web/blob/master/tool/generate_sass.dart.

Running that script will install (https://www.npmjs.com/package/material-components-web) version 14.0.0, and attempt to set up the SASS dependencies, but there's a few import issues when I try to run DartPad:


[SEVERE] sass_builder on lib/scss/material_shared.scss: Error: Undefined mixin.
   ╷
13 │   @include mdc-icon-button-size(14px);
   │   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  - 13:3  root stylesheet

I'm not sure why this mixin isn't available - it probably just needs to be imported.

@johnpryan
Copy link
Contributor

It looks like that mixin is deprecated, we'll need to figure out what the upgrade path looks like, but for now I'll try to remove any deprecated mixins and get DartPad building with material-components-web 14.0.0

@johnpryan
Copy link
Contributor

For now, I was able to upgrade dart-sass and sass_builder to the latest version: #2537

@johnpryan
Copy link
Contributor

I played around with package:mdc_web's generate_sass.dart script, to try different versions of the material-components-web NPM package.

  var result = await Process.run('npm', ['install', 'material-components-web@12.0.0']);

I tried 12.0.0, 13.0.0, and 14.0.0, but there are breaking changes that break mixins that dart-pad uses. Anywhere DartPad is using a mixin that starts with@include mdc-* is affected.

@parlough
Copy link
Member Author

I'm going to close this as we aren't going to be using the package anymore, and the underlying web library has been superseded by a new, simplified component library anyway - https://material-web.dev/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-tech-debt
Projects
None yet
Development

No branches or pull requests

2 participants