Atualizar postcss-selector-parser de 6.x para 7.x
Comparação da API pública de postcss-selector-parser 6.1.6 e 7.2.1, calculada automaticamente a partir dos tipos TypeScript. Uma assinatura alterada é uma possível mudança incompatível, não uma certeza.
Resumo
| Caminhos de importação removidos | 0 |
|---|---|
| Exports removidos | 1 |
| Assinaturas alteradas | 1 |
| Membros de classes ou interfaces removidos | 0 |
| Membros de classes ou interfaces alterados | 9 |
| Novas descontinuações | 0 |
| Mudanças de requisitos (engines, dependências peer) | 1 |
| Novos exports | 0 |
Exports removidos
| import | export | kind | Antes |
|---|---|---|---|
postcss-selector-parser | _Selector | interface | interface |
Assinaturas alteradas
| export | Antes | Depois |
|---|---|---|
postcss-selector-parser · Selector | _Selector<Selector> | interface |
Membros de classes ou interfaces removidos
Nenhuma detectada.
Membros de classes ou interfaces alterados
| member | Antes | Depois |
|---|---|---|
Root.insertAfter | (oldNode: Selector, newNode: Selector): Root | (oldNode: Selector, newNode: Selector, ...restNode: Selector[]): Root |
Root.insertBefore | (oldNode: Selector, newNode: Selector): Root | (oldNode: Selector, newNode: Selector, ...restNode: Selector[]): Root |
Pseudo.insertAfter | (oldNode: Selector, newNode: Selector): Pseudo | (oldNode: Selector, newNode: Selector, ...restNode: Selector[]): Pseudo |
Pseudo.insertBefore | (oldNode: Selector, newNode: Selector): Pseudo | (oldNode: Selector, newNode: Selector, ...restNode: Selector[]): Pseudo |
Attribute.raws | { unquoted?: string | undefined; attribute?: string | undefined; operator?: string | undefined; value?: string | undefined; insensitive?: string | undefined; spaces?: { attribute?: Partial<Spaces> | undefined; operator?: Partial<Spaces> | undefined; value?: Partial<Spaces> | undefined; insensitive?:… | { unquoted?: string | undefined; attribute?: string | undefined; operator?: string | undefined; value?: string | undefined; insensitive?: string | undefined; insensitiveFlag?: string | undefined; sensitiveFlag?: string | undefined; spaces?: { attribute?: Partial<Spaces> | undefined; operator?: Parti… |
Attribute.offsetOf | (part: "attribute" | "ns" | "namespace" | "attributeNS" | "operator" | "value" | "insensitive"): number | (part: "attribute" | "ns" | "namespace" | "attributeNS" | "operator" | "value" | "insensitive" | "sensitive"): number |
Container.insertAfter | (oldNode: Child, newNode: Child): Container<Value, Child> | (oldNode: Child, newNode: Child, ...restNode: Child[]): Container<Value, Child> |
Container.insertBefore | (oldNode: Child, newNode: Child): Container<Value, Child> | (oldNode: Child, newNode: Child, ...restNode: Child[]): Container<Value, Child> |
AttributeOptions.raws | { unquoted?: string | undefined; attribute?: string | undefined; operator?: string | undefined; value?: string | undefined; insensitive?: string | undefined; spaces?: { attribute?: Partial<Spaces> | undefined; operator?: Partial<Spaces> | undefined; value?: Partial<Spaces> | undefined; insensitive?:… | { unquoted?: string | undefined; attribute?: string | undefined; operator?: string | undefined; value?: string | undefined; insensitive?: string | undefined; insensitiveFlag?: string | undefined; sensitiveFlag?: string | undefined; spaces?: { attribute?: Partial<Spaces> | undefined; operator?: Parti… |
Novas descontinuações
Nenhuma detectada.
Mudanças de requisitos (engines, dependências peer)
| Antes | Depois | |
|---|---|---|
engines.node | >=4 | — |
Changelog entre estas versões
Texto publicado pelos autores do pacote, exibido como está.
7.2.1
- revert: the class constructor writes `value` as given again, as it did through 7.1.8. 7.2.0 escaped it, so the names CSS Modules builds (postcss-modules-scope with css-loader) were escaped a second time and their selectors stopped matching ([#362](https://github.com/postcss/postcss-selector-parser/issues/362), reported by [@denniskigen](https://github.com/denniskigen))
- revert: assigning to an id's `value` writes it as given again, as it did through 7.1.8, for the same reason. Both changes are parked for the next major ([#357](https://github.com/postcss/postcss-selector-parser/issues/357))
- fix(types): spell `Selector` without a self-referencing type alias, which TypeScript 7.1 previews reject with TS5115, while its children still exclude `Selector` ([#348](https://github.com/postcss/postcss-selector-parser/issues/348), [#350](https://github.com/postcss/postcss-selector-parser/pull/350) by [@firefoxic](https://github.com/firefoxic))
- docs: state the 7.x contract for `className` and `id` values in `API.md`7.2.0
- feat: add the opt-in `maxInputLength` option, which rejects a selector longer than the limit before parsing it
- feat: support the case-sensitive attribute flag `s` per Selectors Level 4, on `Attribute#sensitive` and `Attribute#sensitiveFlag`. `[a=b s]` previously left `insensitive: false` and filed the flag in `raws.insensitiveFlag` ([#327](https://github.com/postcss/postcss-selector-parser/pull/327) by [@abhu85](https://github.com/abhu85))
- docs: add a threat model to `SECURITY.md`: resource consumption caused by unbounded untrusted input is now handled as a regular bug
- docs: document the raw-value helpers (`stringifyProperty`, `valueToString`, `setPropertyAndEscape`, `appendToPropertyAndEscape`, `setPropertyWithoutEscape`), the seventeen type guards, and the `clone()` overrides argument ([#231](https://github.com/postcss/postcss-selector-parser/issues/231))
- fix: forward the default options given to the parser factory, so `parser(fn, { maxInputLength })` and the other options take effect there as documented ([#345](https://github.com/postcss/postcss-selector-parser/pull/345) by [@Aurantium-47](https://github.com/Aurantium-47))
- fix: preserve the spaces declared on selector and root containers, through `rawSpaceBefore` and `rawSpaceAfter` ([#356](https://github.com/postcss/postcss-selector-parser/pull/356) by [@Aschenbath](https://github.com/Aschenbath))
- fix: preserve selector delimiters after an escaped backslash, so `.a\\.b` parses as two classes ([#354](https://github.com/postcss/postcss-selector-parser/pull/354) by [@wozhenbang2004](https://github.com/wozhenbang2004))
- fix: escape class values supplied to the constructor, matching what the `value` setter already did ([#349](https://github.com/postcss/postcss-selector-parser/pull/349) by [@SAY-5](https://github.com/SAY-5))
- fix: escape values assigned to an id through the `value` setter, and replace a stale `raws.value` on assignment ([#326](https://github.com/postcss/postcss-selector-parser/pull/326) by [@mahirhir](https://github.com/mahirhir))
- fix: keep `$` in an attribute name inside a preprocessor interpolation, so `[#{$attr}]` in SCSS and `[@{attr}]` in Less round-trip ([#336](https://github.com/postcss/postcss-selector-parser/pull/336) by [@theRizwan](https://github.com/theRizwan))
- fix: reject an attribute selector with no valid attribute name, instead of throwing a raw `TypeError` or emitting the literal text `undefined` ([#335](https://github.com/postcss/postcss-selector-parser/pull/335) by [@theRizwan](https://github.com/theRizwan))
- fix: keep the processor's entry points usable when destructured, as in `const { process } = parser()` ([#145](https://github.com/postcss/postcss-selector-parser/issues/145))
### Behaviour notes
- `className` and `id` values are escaped when passed to a constructor or assigned through `value`, so an already-escaped value is now escaped twice. `setPropertyWithoutEscape()` is the escape hatch. Reverted in 7.2.1.
- `[a=b s]` sets `sensitiv7.1.8
- fix: parse selectors in linear time on four more kinds of crafted input, closing a CPU exhaustion vulnerability ([GHSA-67xj-gfww-g738](https://github.com/advisories/GHSA-67xj-gfww-g738), reported by [@zachariah-mithani](https://github.com/zachariah-mithani))
- chore: replace the `cssesc` dependency with an internal copy, whose redundant space removal is linear7.1.7
- fix: `lossless: true` preserves trailing whitespace in a selector that ends empty, such as `:not(a, )`. Note that `:not( )` now yields a selector holding one empty string node rather than an empty selector ([#337](https://github.com/postcss/postcss-selector-parser/pull/337) by [@theRizwan](https://github.com/theRizwan))
- fix: consume the whitespace that terminates a hexadecimal escape, so `[x="\000061 b"]` unescapes to `ab` ([#340](https://github.com/postcss/postcss-selector-parser/pull/340) by [@jakezwang](https://github.com/jakezwang))
- fix: set the parent on every node passed to `insertBefore` and `insertAfter`, not only the first ([#343](https://github.com/postcss/postcss-selector-parser/pull/343) by [@feritcemkahraman](https://github.com/feritcemkahraman))
- fix: assigning `combinator.value` clears the stale raw spelling instead of being ignored ([#342](https://github.com/postcss/postcss-selector-parser/pull/342) by [@SAY-5](https://github.com/SAY-5))
- fix: keep whitespace around the namespace separator in attribute selectors, so `[ foo | bar ]` round-trips ([#339](https://github.com/postcss/postcss-selector-parser/pull/339) by [@dkryaklin](https://github.com/dkryaklin))7.1.6
- fix: parse flat selectors in linear time, closing a CPU exhaustion vulnerability ([CVE-2026-104844](https://github.com/advisories/GHSA-rj75-hqrm-r3gf) / GHSA-rj75-hqrm-r3gf, reported by Wayde Shi)7.1.5
- fix: don't treat a non-prefix token before `|` as a namespace ([#324](https://github.com/postcss/postcss-selector-parser/pull/324) by [@spokodev](https://github.com/spokodev))
- fix: preserve whitespace before a `*` namespace in attribute selectors ([#325](https://github.com/postcss/postcss-selector-parser/pull/325) by [@spokodev](https://github.com/spokodev))
- fix: TypeError on unclosed `[`, `(` and trailing `|` ([#330](https://github.com/postcss/postcss-selector-parser/pull/330) by [@theRizwan](https://github.com/theRizwan))7.1.4
- fix: tolerate non-node children when serializing selectors7.1.3
- Improve fix CVE-2026-9358 (NVD) / SNYK-JS-POSTCSSSELECTORPARSER-16873882 (clone/walk)7.1.2
- Fix [CVE-2026-9358](https://github.com/advisories/GHSA-w9m9-85wc-3x92) (NVD) / SNYK-JS-POSTCSSSELECTORPARSER-16873882 ([#316](https://github.com/postcss/postcss-selector-parser/pull/316) by [@MoOx](https://github.com/MoOx))7.1.1
- perf: replace startsWith with strict equality (#308)
- fix(types): add walkUniversal declaration (#311)7.1.0
- feat: insert(Before|After) support multiple new node7.0.0
- Feat: make insertions during iteration safe (major)Dê estes dados ao seu agente de IA
Vigia é um servidor MCP gratuito: seu agente de programação verifica versões, mudanças incompatíveis e vulnerabilidades antes de escrever código. Sem cadastro, sem chave de API.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Adicionar ao CursorAdicionar ao VS Code★ Estrela no GitHub
Qualquer outro cliente MCP
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }Skill para agentes (SKILL.md): diz ao agente quando usar o Vigia · GitHub Action para pull requests
Perguntas frequentes
Quais são as mudanças incompatíveis ao atualizar postcss-selector-parser de 6 para 7?
Entre postcss-selector-parser 6.1.6 e 7.2.1, o Vigia encontrou 1 exports removidos, 1 assinaturas alteradas e 9 membros de classes ou interfaces removidos ou alterados.
O que foi descontinuado em postcss-selector-parser 7?
0 exports ou membros foram marcados como descontinuados em postcss-selector-parser 7.2.1.
Para agentes
GET https://vigia.coredls.cloud/v1/packages/npm/postcss-selector-parser/upgrade?from=6.1.6&to=7.2.1