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

chore(deps): update dependency lightningcss to v1.22.0 #839

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 1, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
lightningcss 1.20.0 -> 1.22.0 age adoption passing confidence

Release Notes

parcel-bundler/lightningcss (lightningcss)

v1.22.0

Compare Source

Added

  • Updated CSS nesting to the latest spec which allows element selectors to be nested without a preceding & selector. Since it is shipping in all major browsers, nesting support is now enabled by default (no need to add to the drafts config). 🥳
  • Support for parsing the @​scope rule

Fixed

  • Fix bugs merging rules containing :is and :-webkit-any
  • Fix specificity of :not selector list down leveling. Instead of :not(.a, .b) compiling to :not(.a):not(.b), it now compiles to :not(:is(.a, .b)) (down leveled to :-webkit-any if needed). This preserves the specificity rather than raising it for each :not.
  • Fix the version selector in the playground on lightningcss.dev
  • Updated the Vite usage docs now that it is built in

v1.21.8

Compare Source

v1.21.7

Compare Source

v1.21.6

Compare Source

Fixes

v1.21.5

Compare Source

Fixed node segmentation fault when throwing an error in a custom visitor using the bundleAsync API - parcel-bundler/lightningcss@50dad7f

v1.21.4

Compare Source

v1.21.3

Compare Source

v1.21.2

Compare Source

Fixes
  • Propagate error location info to JS in bundler APIs – 91ec8d3
  • Omit analyzeDependencies option from bundler APIs in TypeScript definitions – ae97aa1
  • Fix deduplicating multiple copies of the same rule – a8d909a

v1.21.1

Compare Source

Fixes

  • Ensure fallback rules for logical properties are before nested rules – e66d99c
  • Fix Safari compat data for ::marker pseudo element – cff779d
  • Add compat data for ::part pseudo element – fbf0d24
  • Avoid splitting and vendor prefixing :is() when we can safely unwrap it – 8d94ea1
  • Ensure split incompatible rules get the correct vendor prefix – d6e1295
  • Add semicolon after declarations if preserving nesting – acde78b
  • Preserve license comments at the start of a stylesheet – 5cec8be
  • Do not crash on currentColor in color-mix() or relative color syntax – 20c9612
  • Specify exact version of lightningcss-derive in Rust crate – 1203368

v1.21.0

Compare Source

This release includes new features to improve compatibility of output CSS with your browser targets, and safely remove old fallbacks that aren't needed anymore. It also gives you more control over exactly how CSS is compiled, and fixes some bugs.

Preserve manual fallbacks

Lightning CSS will now preserve manually provided fallback values when some of your browser targets do not support the last one. For example, in the following rule, if some targets didn't support the max function, both declarations would be preserved. Otherwise, if we are sure that all targets support it, Lightning CSS will drop the fallback declaration.

.foo {
  margin-right: 22px;
  margin-right: max(4%, 22px);
}

This is supported for many types of values such as lengths, colors, gradients, images, font styles, etc. It uses compatibility data from caniuse and MDN to determine if each value is supported.

Include and exclude options

You can now control exactly how Lightning CSS compiles using the "include" and "exclude" options, in addition to the existing "targets". This allows you to explicitly turn on or off certain features, which overrides the defaults based on the provided browser targets. For example, you might want to only compile colors, and handle auto prefixing or other features with another tool. Or you may want to handle everything except vendor prefixing with Lightning CSS. These options make that possible.

An enum of available feature flags is provided, and you can use the bitwise OR operator to combine flags together, e.g. Features.Nesting | Features.Colors. There are also some flags which turn on multiple other flags at once, e.g. Selectors, Colors, and MediaQueries. The playground has been updated to show these flags and includes checkboxes to turn them on or off.

import {transform, Features, browserslistToTargets} from 'lightningcss';
import browserslist from 'browserslist';

transform({
  // ...
  // Turn on color and nesting compilation, regardless of browser targets.
  include: Features.Colors | Features.Nesting,
  targets: browserslistToTargets(browserslist('last 1 Chrome version'))
});

The Rust API has been updated to accept a new Targets struct instead of Browsers. This includes browser targets as a sub-field, along with the include and exclude options. See docs.rs for more details.

Split selector lists when unsupported

Lightning CSS will now automatically split selector lists when your browser targets don't support some selectors. This avoids a case where browsers ignore the whole rule if only some selectors are unsupported. It takes advantage of :is() forgiving selector lists where possible, otherwise generates multiple rules. For example:

:hover, :focus-visible {
  color: red;
}

will be compiled to the following if :focus-visible is not supported by one of your targets:

:is(:hover, :focus-visible) {
  color: red;
}

If :is() is unsupported, or if the selectors have different specificities, Lightning CSS will output the following instead:

:hover {
  color: red;
}

:focus-visible {
  color: red;
}

Non-standard selector compatibility

Some frameworks like Angular and View support some non-standard selectors, such as the ::v-deep pseudo element, >>> and /deep/ combinators, and :deep(<selector-list>) syntax. These are now able to be parsed and preserved as is by Lightning CSS. Unknown pseudo elements now allow arbitrary selectors after them unlike normal standard pseudo elements. Unknown functional pseudo selectors will preserve their arguments unmodified. Non-standard combinators can be enabled by adding the following option when compiling:

{
  nonStandard: {
    deepSelectorCombinator: true
  }
}

More


Configuration

📅 Schedule: Branch creation - "before 5pm on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 52bf05e to ad6d4ab Compare October 1, 2023 20:53
@maxmilton maxmilton closed this Oct 3, 2023
@renovate
Copy link
Contributor Author

renovate bot commented Oct 4, 2023

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (1.22.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/lightningcss-1.x branch October 4, 2023 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant