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

[Proposal] Explore the possibility of a "Universal Adapter" interface #840

Open
traviskaufman opened this issue Jun 19, 2017 · 0 comments
Open

Comments

@traviskaufman
Copy link
Contributor

Background / Problem

MDC-Web was designed from the ground up to integrate with frameworks. Our initial solution to the problem of widely varying environments and host framework APIs (virtual DOM, shadow DOM, incremental DOM, no DOM, etc.) was our Component / Foundation / Adapter architecture model.

Since we've released MDC-Web we've built ~30 components using this model. Furthermore, we've been able to prove out its use case both by building our own framework examples and through our external community's use of the model.

That being said, we've also been able to see a few problems with the approach, such as the following:

  • Duplication of logic across components: Almost all adapter interfaces require the user to implement addClass, removeClass, etc.
  • Hard to understand / large learning curve: Many contributors seem to be confused / frustrated by writing adapters and instead opt to just wrap our vanilla components (An example of integrating with React without the Foundation / Adapter pattern #407, React example complexity #393, Add createAdapter to other components? #728).
  • O(n) effort: Every component needs to have its adapter implemented separately; N adapters for N components
  • Lots of breaking changes: Every time an adapter interface is modified, it's a breaking change
  • Documentation overhead: Every adapter API needs to be documented in a README. This leads to developers wanting to implement Material Components for their framework needing to peruse multiple files scattered across multiple locations. This is made even worse if by error we forget to document a specific adapter method.

Solution - A "Universal Adapter" interface

The main idea here is to build one single adapter per platform/framework, instead of per component.

We had talked about this idea during the initial design phase of MDC-Web, but punted on it because we didn't want to try and build an overarching adapter without knowing exactly what it would need, thus have it be subject to a lot of churn. I feel like we've built enough into the library now that we would have a good idea of what it would need to facilitate.

For example, for our vanilla components there would be one MDCVanillaDOMAdapter (or some other, better name) that would implement every method required for every foundation to interact with its host environment. As such, it would expect components to be structured in a certain way and share a common interface and way of doing things. For example, it might expect that all components expose a property root that allows access to the underlying DOM element the component is wrapping. This adapter could then be used by all foundation code. Thus, components simply become idiomatic wrappers for foundations, and do not have to implement any of the adapter logic themselves.

Using a single, universal adapter presents much less of a learning curve. Rather than have to think about how to build an adapter every time a developer wants to build / integrate a component, she instead would only have to learn how to use one single adapter across multiple components. While there would still be a learning curve WRT foundations / components, not having to figure out how to write or implement an adapter would save the developer a lot of time. Furthermore, frameworks like angular have similar mechanisms for dealing with heterogeneous platforms (see platform-* packages).

A single adapter also means that documentation on how to build and design ones own adapters would be centralized, rather than spread out across the codebase. This means that if framework authors wanted to build an adapter for their framework, they could find the entire specification for what would be needed in one location.

Finally, this means that we could theoretically take on the task of building adapters for frameworks other than the vanilla DOM. React would be a great place to start with this. There are currently ~12 dependent react wrapper packages for MDC-Web on npm, each with varying degrees of support and fidelity. By building an official adapter, we could remove an extremely large barrier when building Material Design components for these frameworks.

Open-ended questions

What goes in the interface? What doesn't?

Need to audit common operations and figure out how to apply them across elements. A big question here is how to target arbitrary "DOM elements" that need to be queried / modified. One approach here could be to use unique strings or Symbols as abstract identifiers for component elements:

// mdc-textfield/foundation.js

export const ROOT = Symbol('mdc-textfield');
export const LABEL_ELEMENT = Symbol('mdc-textfield__label');

// somewhere in the code...
this.adapter_.addClass(ROOT, cssClasses.FOCUSED);
this.adapter_.addClass(LABEL_ELEMENT, cssClasses.LABEL_FLOAT_ABOVE);

These identifiers could then be mapped to elements in component code.

How do we handle heirarchal component relationships?

Components like MDCTabBar and MDCSelect have adapter methods that operate on subcomponents rather than elements, e.g. getOffsetLeftForTabAtIndex. We'd have to figure out a way to facilitate these relationships using a universal adapter.

How do we ensure adapters do not become extremely overcomplicated?

Having one gigantic, overly-complex adapter API is just as bad as having 10s of smaller, less-complex adapter APIs, IMO. We'd have to put a lot of thought into designing an adapter interface that's resilient enough to facilitate the majority of future use cases that new components will require. We don't want more breaking changes because due to continuously updating one single adapter.

acdvorak pushed a commit that referenced this issue Dec 14, 2018
## The devDependency [css-loader](https://github.com/webpack-contrib/css-loader) was updated from `1.0.1` to `2.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v2.0.0</summary>

<p><a name="user-content-2.0.0"></a></p>
<h1><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/v1.0.1...v2.0.0">2.0.0</a> (2018-12-07)</h1>
<p>The main <strong>BREAKING CHANGES</strong>:</p>
<ul>
<li>css modules <strong>are disabled by default</strong>, you need setup their use <code>modules</code> option. You can setup their using <code>local</code> (<code>true</code> is alias for this value) and <code>global</code> (previous behaviour) value. Why it is disabled by default? A lot of developers use <code>css</code> without css modules features and they get performance problems due <code>postcss</code> plugins spend time on analyze and processing file.</li>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>broken unucode characters (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/850" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/850/hovercard">#850</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c70">f599c70</a>)</li>
<li>correctly processing <code>urls()</code> with <code>?#hash</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/803" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/803/hovercard">#803</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/417d105">417d105</a>)</li>
<li>don't break loader on invalid or not exists url or import token (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/827" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/827/hovercard">#827</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9e52d26">9e52d26</a>)</li>
<li>don't duplicate import with same media in different case (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/819" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/819/hovercard">#819</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9f66e33">9f66e33</a>)</li>
<li>emit warnings on broken <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/806" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/806/hovercard">#806</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/4bdf08b">4bdf08b</a>)</li>
<li>handle uppercase <code>URL</code> in <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/818" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/818/hovercard">#818</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3ebdcd5">3ebdcd5</a>)</li>
<li>inconsistent generate class names for css modules on difference os (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/812" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/812/hovercard">#812</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/0bdf9b7">0bdf9b7</a>)</li>
<li>reduce number of <code>require</code> for <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/854" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/854/hovercard">#854</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3338656">3338656</a>)</li>
<li>support deduplication of string module ids (optimization.namedModules) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/789" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/789/hovercard">#789</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e3bb83a">e3bb83a</a>)</li>
<li>support module resolution in <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/845" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/845/hovercard">#845</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/453248f">453248f</a>)</li>
<li>same <code>urls()</code> resolving logic for <code>modules</code> (<code>local</code> and <code>global</code>) and without modules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/843" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/843/hovercard">#843</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/fdcf687">fdcf687</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>allow to disable css modules and <strong>disable their by default</strong> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/842" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/842/hovercard">#842</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/889dc7f">889dc7f</a>)</li>
<li>disable <code>import</code> option doesn't affect on <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/822" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/822/hovercard">#822</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f9aa73c">f9aa73c</a>)</li>
<li>allow to filter <code>urls</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/856" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/856/hovercard">#856</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7">5e702e7</a>)</li>
<li>allow to filter <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/857" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/857/hovercard">#857</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034c">5e6034c</a>)</li>
<li>emit warning on invalid <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/832" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/832/hovercard">#832</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/da95db8">da95db8</a>)</li>
<li>added <code>exportOnlyLocals</code> option (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/824" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/824/hovercard">#824</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e9327c0">e9327c0</a>)</li>
<li>reuse <code>postcss</code> ast from other loaders (i.e <code>postcss-loader</code>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/840" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/840/hovercard">#840</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1dad1fb">1dad1fb</a>)</li>
<li>schema options (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b97d997">b97d997</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
<li>by default css modules are disabled (now <code>modules: false</code> disable all css modules features), you can return old behaviour change this on <code>modules: 'global'</code></li>
<li><code>css-loader/locals</code> was dropped in favor <code>exportOnlyLocals</code> option</li>
<li><code>import</code> option only affect on <code>import</code> at-rules and doesn't affect on <code>composes</code> declarations</li>
<li>invalid <code>@import</code> at rules now emit warnings</li>
<li>use <code>postcss@7</code></li>
</ul>
<h3>Bonus</h3>
<ul>
<li>code refactoring, updating deps and reusing <code>postcss</code> ast increase performance</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 67 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/634ab49c17b284e55e62105109412ebd37e234b5"><code>634ab49</code></a> <code>chore(release): 2.0.0</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/6ade2d0e7c04031c79841f1f741d986430a5aed7"><code>6ade2d0</code></a> <code>refactor: remove unused file (#860)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e7525c90718018b75321f1e04909d6937b6ad140"><code>e7525c9</code></a> <code>test: nested url (#859)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/7259faa89dc70830d69b7eb7baf4163065b63679"><code>7259faa</code></a> <code>test: css hacks (#858)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034cee840d47dbfd9fdede87a152e4cfc466a"><code>5e6034c</code></a> <code>feat: allow to filter import at-rules (#857)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7d2e081b7f6d372f0c967fdfca6a40a584"><code>5e702e7</code></a> <code>feat: allow filtering urls (#856)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9642aa5ad70282f5a7bef8e95ceefdc834af1af1"><code>9642aa5</code></a> <code>test: css stuff (#855)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/333865645e21c15e8589724317111d9d6badbeba"><code>3338656</code></a> <code>fix: reduce number of require for url (#854)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/533abbe8cf2b937751f3d4501816611a230083d2"><code>533abbe</code></a> <code>test: issue 636 (#853)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/08c551cc78bb484a4f947047cbc46b305e733d7e"><code>08c551c</code></a> <code>refactor: better warning on invalid url resolution (#852)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b0aa159cbb951774a2c09b37f093dd95d23ebbd3"><code>b0aa159</code></a> <code>test: issue #589 (#851)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c7087466ca293989531805ef367b388d13f1"><code>f599c70</code></a> <code>fix: broken unucode characters (#850)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1e551f338bf6a22541e3dab7943429b01cae02ab"><code>1e551f3</code></a> <code>test: issue 286 (#849)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/419d27b0836be683a1f0cc786ec47e7f80617842"><code>419d27b</code></a> <code>docs: improve readme (#848)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/d94a698d9d144fb91a9d1fdfb8cd4433e410e70e"><code>d94a698</code></a> <code>refactor: webpack-default (#847)</code></li>
</ul>
<p>There are 67 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/10c3bc31bedcfffe35a8e65e82397d4dd632f6c0...634ab49c17b284e55e62105109412ebd37e234b5">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
adrianschmidt pushed a commit to Lundalogik/material-components-web that referenced this issue Jan 4, 2019
…#4153)

## The devDependency [css-loader](https://github.com/webpack-contrib/css-loader) was updated from `1.0.1` to `2.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v2.0.0</summary>

<p><a name="user-content-2.0.0"></a></p>
<h1><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/v1.0.1...v2.0.0">2.0.0</a> (2018-12-07)</h1>
<p>The main <strong>BREAKING CHANGES</strong>:</p>
<ul>
<li>css modules <strong>are disabled by default</strong>, you need setup their use <code>modules</code> option. You can setup their using <code>local</code> (<code>true</code> is alias for this value) and <code>global</code> (previous behaviour) value. Why it is disabled by default? A lot of developers use <code>css</code> without css modules features and they get performance problems due <code>postcss</code> plugins spend time on analyze and processing file.</li>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>broken unucode characters (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/850" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/850/hovercard">material-components#850</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c70">f599c70</a>)</li>
<li>correctly processing <code>urls()</code> with <code>?#hash</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/803" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/803/hovercard">material-components#803</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/417d105">417d105</a>)</li>
<li>don't break loader on invalid or not exists url or import token (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/827" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/827/hovercard">material-components#827</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9e52d26">9e52d26</a>)</li>
<li>don't duplicate import with same media in different case (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/819" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/819/hovercard">material-components#819</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9f66e33">9f66e33</a>)</li>
<li>emit warnings on broken <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/806" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/806/hovercard">material-components#806</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/4bdf08b">4bdf08b</a>)</li>
<li>handle uppercase <code>URL</code> in <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/818" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/818/hovercard">material-components#818</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3ebdcd5">3ebdcd5</a>)</li>
<li>inconsistent generate class names for css modules on difference os (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/812" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/812/hovercard">material-components#812</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/0bdf9b7">0bdf9b7</a>)</li>
<li>reduce number of <code>require</code> for <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/854" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/854/hovercard">material-components#854</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3338656">3338656</a>)</li>
<li>support deduplication of string module ids (optimization.namedModules) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/789" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/789/hovercard">material-components#789</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e3bb83a">e3bb83a</a>)</li>
<li>support module resolution in <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/845" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/845/hovercard">material-components#845</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/453248f">453248f</a>)</li>
<li>same <code>urls()</code> resolving logic for <code>modules</code> (<code>local</code> and <code>global</code>) and without modules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/843" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/843/hovercard">material-components#843</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/fdcf687">fdcf687</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>allow to disable css modules and <strong>disable their by default</strong> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/842" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/842/hovercard">material-components#842</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/889dc7f">889dc7f</a>)</li>
<li>disable <code>import</code> option doesn't affect on <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/822" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/822/hovercard">material-components#822</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f9aa73c">f9aa73c</a>)</li>
<li>allow to filter <code>urls</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/856" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/856/hovercard">material-components#856</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7">5e702e7</a>)</li>
<li>allow to filter <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/857" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/857/hovercard">material-components#857</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034c">5e6034c</a>)</li>
<li>emit warning on invalid <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/832" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/832/hovercard">material-components#832</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/da95db8">da95db8</a>)</li>
<li>added <code>exportOnlyLocals</code> option (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/824" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/824/hovercard">material-components#824</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e9327c0">e9327c0</a>)</li>
<li>reuse <code>postcss</code> ast from other loaders (i.e <code>postcss-loader</code>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/840" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/840/hovercard">material-components#840</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1dad1fb">1dad1fb</a>)</li>
<li>schema options (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b97d997">b97d997</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
<li>by default css modules are disabled (now <code>modules: false</code> disable all css modules features), you can return old behaviour change this on <code>modules: 'global'</code></li>
<li><code>css-loader/locals</code> was dropped in favor <code>exportOnlyLocals</code> option</li>
<li><code>import</code> option only affect on <code>import</code> at-rules and doesn't affect on <code>composes</code> declarations</li>
<li>invalid <code>@import</code> at rules now emit warnings</li>
<li>use <code>postcss@7</code></li>
</ul>
<h3>Bonus</h3>
<ul>
<li>code refactoring, updating deps and reusing <code>postcss</code> ast increase performance</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 67 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/634ab49c17b284e55e62105109412ebd37e234b5"><code>634ab49</code></a> <code>chore(release): 2.0.0</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/6ade2d0e7c04031c79841f1f741d986430a5aed7"><code>6ade2d0</code></a> <code>refactor: remove unused file (material-components#860)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e7525c90718018b75321f1e04909d6937b6ad140"><code>e7525c9</code></a> <code>test: nested url (material-components#859)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/7259faa89dc70830d69b7eb7baf4163065b63679"><code>7259faa</code></a> <code>test: css hacks (material-components#858)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034cee840d47dbfd9fdede87a152e4cfc466a"><code>5e6034c</code></a> <code>feat: allow to filter import at-rules (material-components#857)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7d2e081b7f6d372f0c967fdfca6a40a584"><code>5e702e7</code></a> <code>feat: allow filtering urls (material-components#856)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9642aa5ad70282f5a7bef8e95ceefdc834af1af1"><code>9642aa5</code></a> <code>test: css stuff (material-components#855)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/333865645e21c15e8589724317111d9d6badbeba"><code>3338656</code></a> <code>fix: reduce number of require for url (material-components#854)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/533abbe8cf2b937751f3d4501816611a230083d2"><code>533abbe</code></a> <code>test: issue 636 (material-components#853)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/08c551cc78bb484a4f947047cbc46b305e733d7e"><code>08c551c</code></a> <code>refactor: better warning on invalid url resolution (material-components#852)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b0aa159cbb951774a2c09b37f093dd95d23ebbd3"><code>b0aa159</code></a> <code>test: issue material-components#589 (material-components#851)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c7087466ca293989531805ef367b388d13f1"><code>f599c70</code></a> <code>fix: broken unucode characters (material-components#850)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1e551f338bf6a22541e3dab7943429b01cae02ab"><code>1e551f3</code></a> <code>test: issue 286 (material-components#849)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/419d27b0836be683a1f0cc786ec47e7f80617842"><code>419d27b</code></a> <code>docs: improve readme (material-components#848)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/d94a698d9d144fb91a9d1fdfb8cd4433e410e70e"><code>d94a698</code></a> <code>refactor: webpack-default (material-components#847)</code></li>
</ul>
<p>There are 67 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/10c3bc31bedcfffe35a8e65e82397d4dd632f6c0...634ab49c17b284e55e62105109412ebd37e234b5">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴


(cherry picked from commit 4afb87c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant