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

Build(deps-dev): Bump css-tree from 1.1.3 to 2.0.4 #1028

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 3, 2022

Bumps css-tree from 1.1.3 to 2.0.4.

Release notes

Sourced from css-tree's releases.

2.0.4

  • Extended Node.js support to include ^10
  • Fixed generate() in safe mode to add a whitespace between <dimension-token> and <hash-token>, otherwise some values are broken in IE11, e.g. border properties (#173)
  • Removed allowance for : for an attribute name on AttributeSelector parsing as it does not meet the CSS specs (details)

2.0.3

  • Fixed unintended whitespace on generate() in safe mode between type-selector and id-selector (e.g. a#id). A regression was introduces in 2.0.2 since IE11 fails on values when <hash-token> goes after <ident-token> without a whitespace in the middle, e.g. 1px solid#000. Thus, in one case, a space between the <ident-token> and the <hash-token> is required, and in the other, vice versa. Until a better solution found, a workaround is used on id-selector generation by producing a <delim-token> instead of <hash-token>.

2.0.2

  • Updated width, min-width and max-width syntax definitions
  • Patched counter related syntaxes to match specs until updated in mdn-data
  • Replaced source-map with source-map-js which reduce install size by ~700KB
  • Fixed calc() function consumption on definition syntax matching
  • Fixed generate() auto emitting a whitespace edge cases when next token starts with a dash (minus)
  • Fixed generate() safe mode to cover more cases for IE11
  • Fixed CommonJS bundling by adding browser files dist/data.cjs and dist/version.cjs
  • Added exports:
    • css-tree/definition-syntax-data
    • css-tree/definition-syntax-data-patch

2.0.1

  • Extended Node.js support to include ^12.20.0 and ^14.13.0 versions

2.0 – ESM support, no white space nodes on AST, auto encode/decode string and url values, and more

ES2020 syntax and support for ESM

The source code was refactored to use ES2020 syntax and ES modules by default. However, Commonjs version of library is still supported, so the package became a dual module. Using ESM allowed to reduce bundle size from 167Kb down to 164Kb despite that mdn-data grew up in size by 11Kb.

In case only a part of CSSTree functionality is used (for instance only for a parsing), it's possible now to use specific exports like css-tree/parser (see the full list of exports) to reduce a bundle size. As new package mechanics are used, the minimal version for Node.js was changed to 14.16+.

No white space nodes on AST anymore

Previously white spaces was preserved on CSS parsing as a WhiteSpace node with a single space. This was mostly needed to avoid combining the CSS tokens into one when generating back into a CSS string. This is no longer necessary, as the generator has been reworked to independently determine when to use spaces in output. This simplify analysis and construction of the AST, and also improves the performance and memory consumption a bit.

Some changes have been made to the AST construction during parsing. First of all, white spaces in selectors are now producing { type: 'Combinator', name: ' ' } nodes when appropriate. Second, white spaces surrounding operators - and + are now replacing with a single space and appending to operators to preserve a behaviour of expressions in calc() functions. Finally, the only case a WhiteSpace node is now created is a custom property declaration with a single whitespace token as the value, since --var: ; and --var:; have different behaviour in terms of CSS.

Improved generator

CSS Syntax Module defines rules for CSS serialization that it must "round-trip" with parsing. Starting with this release the CSSTree's generator follows these rules and determines itself when to output the space to avoid unintended CSS tokens combining.

The spec rules allow to omit whitespaces in most cases. However, some older browsers fail to parse the resulting CSS because they didn't follow the spec. For this reason, the generator supports two modes:

  • safe (by default) which adds an extra space in some edge cases;
  • spec which completely follows the spec.
import { parse, generate } from 'css-tree';
const ast = parse('a { border: calc(1px) solid #ff0000 }');
</tr></table>

... (truncated)

Changelog

Sourced from css-tree's changelog.

2.0.4 (December 17, 2021)

  • Extended Node.js support to include ^10
  • Fixed generate() in safe mode to add a whitespace between <dimension-token> and <hash-token>, otherwise some values are broken in IE11, e.g. border properties (#173)
  • Removed allowance for : for an attribute name on AttributeSelector parsing as it does not meet the CSS specs (details)

2.0.3 (December 14, 2021)

  • Fixed unintended whitespace on generate() in safe mode between type-selector and id-selector (e.g. a#id). A regression was introduces in 2.0.2 since IE11 fails on values when <hash-token> goes after <ident-token> without a whitespace in the middle, e.g. 1px solid#000. Thus, in one case, a space between the <ident-token> and the <hash-token> is required, and in the other, vice versa. Until a better solution found, a workaround is used on id-selector generation by producing a <delim-token> instead of <hash-token>.

2.0.2 (December 10, 2021)

  • Updated width, min-width and max-width syntax definitions
  • Patched counter related syntaxes to match specs until updated in mdn-data
  • Replaced source-map with source-map-js which reduce install size by ~700KB
  • Fixed calc() function consumption on definition syntax matching
  • Fixed generate() auto emitting a whitespace edge cases when next token starts with a dash (minus)
  • Fixed generate() safe mode to cover more cases for IE11
  • Fixed CommonJS bundling by adding browser files dist/data.cjs and dist/version.cjs
  • Added exports:
    • css-tree/definition-syntax-data
    • css-tree/definition-syntax-data-patch

2.0.1 (December 4, 2021)

  • Extended Node.js support to include ^12.20.0 and ^14.13.0 versions

2.0.0 (December 3, 2021)

  • Package
    • Dropped support for Node.js prior 14.16 (following patch versions changed it to ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0)
    • Converted to ES modules. However, CommonJS is supported as well (dual module)
    • Added exports for standalone parts instead of internal paths usage (use as import * as parser from "css-tree/parser" or require("css-tree/parser")):
      • css-tree/tokenizer
      • css-tree/parser
      • css-tree/walker
      • css-tree/generator
      • css-tree/lexer
      • css-tree/definition-syntax
      • css-tree/utils
    • Changed bundle set to provide dist/csstree.js (an IIFE version with csstree as a global name) and dist/csstree.esm.js (as ES module). Both are minified
    • Bumped mdn-data to 2.0.23
  • Tokenizer
    • Changed tokenize() to take a function as second argument, which will be called for every token. No stream instance is creating when second argument is ommited.
    • Changed TokenStream#getRawLength() to take second parameter as a function (rule) that check a char code to stop a scanning
    • Added TokenStream#forEachToken(fn) method
    • Removed TokenStream#skipWS() method
    • Removed TokenStream#getTokenLength() method
  • Parser
    • Moved SyntaxError (custom parser's error class) from root of public API to parser via parse.SyntaxError

... (truncated)

Commits
  • 929e47a 2.0.4
  • c59aba6 Extend Node.js support to include ^10
  • eb39c12 Update github action setup
  • 38570ac Remove allowance for : for an attribute name on AttributeSelector parsing
  • 17ff757 Fix generate() in safe mode to add a whitespace between \<dimension-token>...
  • 949e04d Use const/let instead of var (#176)
  • a22c8be 2.0.3
  • 9808e2a Tweak code a bit
  • a0aeb55 Fix unintended between type and id selectors on generate in safe mode
  • 173e88a Merge pull request #175 from lazarljubenovic/docs-typos
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [css-tree](https://github.com/csstree/csstree) from 1.1.3 to 2.0.4.
- [Release notes](https://github.com/csstree/csstree/releases)
- [Changelog](https://github.com/csstree/csstree/blob/master/CHANGELOG.md)
- [Commits](csstree/csstree@v1.1.3...v2.0.4)

---
updated-dependencies:
- dependency-name: css-tree
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 3, 2022
@vercel
Copy link

vercel bot commented Jan 3, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ebury/chameleon/984Yfcw79F97akVV9XcGZ3zm9hhw
✅ Preview: https://chameleon-git-dependabot-npmandyarncss-tree-204-ebury.vercel.app

@mcibique mcibique merged commit 60e7da8 into master Feb 11, 2022
@mcibique mcibique deleted the dependabot/npm_and_yarn/css-tree-2.0.4 branch February 11, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant