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

feat: support @value at-rule in selectors #941

Merged
merged 1 commit into from May 28, 2019

Conversation

alexander-akait
Copy link
Member

@alexander-akait alexander-akait commented May 28, 2019

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Support @value at rule in selectors

Breaking Changes

Yes

BREAKING CHANGE: if you have name of @value in selector it will be replaced, you need to rename your name of @value or rename your selector

Additional Info

No

For next major release we need:

  • fix nothing in test of css-loader
  • fix problem when you use @value test: 'something' in selector
  • refactor postcss-icss plugin
  • support this.sourceMap value from webpack

BREAKING CHANGE: if you have name of `@value` in selector it will be replaced, you need to rename your name of `@value` or rename your selector
@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #941 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #941      +/-   ##
==========================================
+ Coverage   99.27%   99.27%   +<.01%     
==========================================
  Files          10       10              
  Lines         412      414       +2     
  Branches      122      124       +2     
==========================================
+ Hits          409      411       +2     
  Misses          3        3
Impacted Files Coverage Δ
src/plugins/postcss-icss-parser.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd8d2e6...113171f. Read the comment docs.

@alexander-akait alexander-akait merged commit 05a42e2 into master May 28, 2019
@alexander-akait alexander-akait deleted the feat-support-@value-at-rules-in-selectors branch May 28, 2019 19:20
@Hypnosphi
Copy link

Hypnosphi commented Jul 4, 2019

Is there any way to opt out of this feature?

I use the following pattern a lot, so now I need a large refactoring to make it work again:

@value myClass from '../some/other.css';

.myClass {
  composes: myClass;
  ...
}

@alexander-akait
Copy link
Member Author

@Hypnosphi no, just rename your variable to v-myClass

I use the following pattern a lot, so now I need a large refactoring to make it work again

It is breaking change for css-loader@3, so it is normal when you need refactor

@Hypnosphi
Copy link

Hypnosphi commented Jul 4, 2019

rename your variable to v-myClass

In some/other.css, it's a classname not a variable:

.myClass {
  /* some styles */
}

Renaming it would mean that in some/other.js I would have to use something like styles['v-myClass'] which looks suboptimal comparing to styles.myClass

@alexander-akait
Copy link
Member Author

@Hypnosphi just use other class or change variable name, it can't be opt, sorry

@princed
Copy link
Contributor

princed commented Aug 6, 2019

@evilebottnawi Would you accept a PR making it possible to opt-out? In our project, we'd have to update about 5000 lines because of the feature.

@alexander-akait
Copy link
Member Author

alexander-akait commented Aug 6, 2019

@princed it can't be option, postcss plugins were rewritten

we'd have to update about 5000 lines because of the feature.

therefore we do major release, just don't update if you don't have time on this right now

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.

None yet

3 participants