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.23.0 #97

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 20, 2023

Mend Renovate

This PR contains the following updates:

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

Release Notes

parcel-bundler/lightningcss (lightningcss)

v1.23.0

Compare Source

This release improves minification for @layer and @property rules, enables relative colors to be compiled in more situations, adds new functionality for custom visitor plugins, and fixes some bugs.

Downlevel relative colors with unknown alpha

Lightning CSS can now down level relative colors where the alpha value is unknown (e.g. a variable). For example:

.foo {
  color: hsl(from yellow h s l / var(--alpha));
}

becomes:

.foo {
  color: hsla(60, 100%, 50%, var(--alpha));
}

Optimized @layer rules

@layer rules with the same name are now merged together and ordered following their original declared order. For example:

@​layer a, b;

@​layer b {
  .foo { color: red }
}

@​layer a {
  .foo { background: yellow }
}

@​layer b {
  .bar { color: red }
}

becomes:

@​layer a {
  .foo { background: yellow }
}

@​layer b {
  .foo, .bar { color: red }
}

Deduped @property rules

@property rules are now deduplicated when they define the same property name. The last rule wins.

@​property --property-name {
  syntax: '<color>';
  inherits: false;
  initial-value: yellow;
}
.foo {
  color: var(--property-name)
}
@&#8203;property --property-name {
  syntax: '<color>';
  inherits: true;
  initial-value: blue;
}

compiles to:

@&#8203;property --property-name{
  syntax: "<color>";
  inherits: true;
  initial-value: #&#8203;00f
}

.foo {
  color: var(--property-name)
}

StyleSheet visitor function

The JS visitor API now supports StyleSheet and StyleSheetExit visitors, allowing you to visit the entire stylesheet at once. This enables things like rule sorting or appending/prepending rules.

let res = transform({
  filename: 'test.css',
  minify: true,
  code: Buffer.from(`
    .foo {
      width: 32px;
    }

    .bar {
      width: 80px;
    }
  `),
  visitor: {
    StyleSheetExit(stylesheet) {
      stylesheet.rules.sort((a, b) => a.value.selectors[0][0].name.localeCompare(b.value.selectors[0][0].name));
      return stylesheet;
    }
  }
});

assert.equal(res.code.toString(), '.bar{width:80px}.foo{width:32px}');

Keep in mind that visiting the entire stylesheet can be expensive, due to needing to serialize and deserialize the entire AST to send between Rust and JavaScript. Keep visitors as granular as you can to avoid this.

Other bug fixes

  • Fixed serializing grid-auto-flow in custom visitors
  • Fixed compatibility data for -webkit-fill-available and -moz-available size values
  • Added support for CommonJS in WASM package
  • Allowed whitespace or nothing in initial-value of @property rules
  • Fixed AST TypeScript types to have correct types for duplicated names

v1.22.1

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), 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.

Copy link

cloudflare-workers-and-pages bot commented Nov 20, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9790166
Status: ✅  Deploy successful!
Preview URL: https://e7a8238b.lrc-maker.pages.dev
Branch Preview URL: https://renovate-lightningcss-1-x.lrc-maker.pages.dev

View logs

Copy link

vercel bot commented Nov 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lrc-maker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 0:40am

Copy link

netlify bot commented Nov 20, 2023

Deploy Preview for lrc-maker ready!

Name Link
🔨 Latest commit 9790166
🔍 Latest deploy log https://app.netlify.com/sites/lrc-maker/deploys/65a47ed6f5192e00086d1743
😎 Deploy Preview https://deploy-preview-97--lrc-maker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@renovate renovate bot changed the title chore(deps): update dependency lightningcss to v1.22.1 chore(deps): update dependency lightningcss to v1.23.0 Jan 15, 2024
@renovate renovate bot force-pushed the renovate/lightningcss-1.x branch from 4e25637 to 9790166 Compare January 15, 2024 00:39
@magic-akari magic-akari merged commit 9790166 into master Jan 15, 2024
5 checks passed
@renovate renovate bot deleted the renovate/lightningcss-1.x branch January 15, 2024 12:30
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.

1 participant