Skip to content

Moving to a more stable way of compiling the styles #333

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

Merged
merged 33 commits into from
Jul 25, 2020
Merged

Conversation

webark
Copy link
Owner

@webark webark commented Sep 21, 2019

Breaking changes in this approach:

  • styleNamespace in addon components needs to be explicitly added al la
    import Component from '@ember/component';
    
    import layout from './template';
    import { styleNamespace } from './styles.css';
    
    export default Component.extend({
      classNameBindings: ['styleNamespace'],
      styleNamespace,
      layout,
    });
    
  • pod-styles has been replaced with ember-styles
  • "classic" layout is not currently supported.
  • there is no more podNames that can be imported from ember-component-css/pod-names
  • do not support prior to ember 3.6
  • do not support below node 10

@webark webark changed the base branch from master to beta July 25, 2020 22:30
webark added 26 commits July 25, 2020 15:33
rather then generating a single `pod-names.js` file with all of the
namespaced styles, moving to a mechanism where each style file
set (style files that are shared the same namespace at the same depth)
gets it's own `style-info.js` file that has the namespacing for that
component.

For components with a `component.js` file, using a babel plugin to
import the `style-info.js` and add the styleNamespace as a class
property, as well as adding it to the classNameBindings.

For routing styles, using a lookup pattern where we are looking up the
given namespace through the owner lookup.

For components without a component.js, creating a base one that defines
the import and sets the class with the layout.

For template-only-glimmer-components, wrapping the contents of the
template in a `let` block that defines the `styleNamespace`.

* moving environment.js 'ember-component-css' config values to
emberCliStyles values that are set in the ember-cli-build.js file.

* Also deprecating the `pod-styles` name for the imported style file
in favor of an `ember-styles` named file.

* Also migrating things to their latest versions as well and moving
things to proper classes.

* Also using preprocessor registries rather then the `treeFor` hooks.

* Also migrated the tests to use the latest modules and hooks.
Setup some base acceptance tests that the different style types share.
in something like `import { foo as bar } from 'fee';` `foo` is the 
imported part, while `bar` is the local. we just want the local
this enables one to import other `styleNamespaces` and use them in
the component.
… building of routes, it should just recive an array
… a route for a cleaner and more predictable api
… when you remove, and I couldn't figure out how to get it back in a good state
@webark webark merged commit 2a2981e into beta Jul 25, 2020
@webark
Copy link
Owner Author

webark commented Jul 25, 2020

ok. an "alpha" tag has been published with the version of 1.0.0-alpha.2

https://www.npmjs.com/package/ember-component-css/v/1.0.0-alpha.2

WIll create a new issue with the remaining work to get to a stable 1.0 version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants