postcss-selector-parser को 6.x से 7.x पर अपग्रेड करना
postcss-selector-parser 6.1.6 और 7.2.1 के सार्वजनिक API की तुलना, उनके TypeScript टाइप से अपने-आप निकाली गई। बदला हुआ सिग्नेचर संभावित असंगत बदलाव है, निश्चितता नहीं।
सारांश
| हटाए गए इम्पोर्ट पाथ | 0 |
|---|---|
| हटाए गए एक्सपोर्ट | 1 |
| बदले गए सिग्नेचर | 1 |
| क्लास या इंटरफ़ेस के हटाए गए सदस्य | 0 |
| क्लास या इंटरफ़ेस के बदले गए सदस्य | 9 |
| नए डिप्रिकेटेड | 0 |
| आवश्यकताओं में बदलाव (engines, peer निर्भरताएँ) | 1 |
| नए एक्सपोर्ट | 0 |
हटाए गए एक्सपोर्ट
| import | export | kind | पहले |
|---|---|---|---|
postcss-selector-parser | _Selector | interface | interface |
बदले गए सिग्नेचर
| export | पहले | बाद में |
|---|---|---|
postcss-selector-parser · Selector | _Selector<Selector> | interface |
क्लास या इंटरफ़ेस के हटाए गए सदस्य
कुछ नहीं मिला।
क्लास या इंटरफ़ेस के बदले गए सदस्य
| member | पहले | बाद में |
|---|---|---|
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… |
नए डिप्रिकेटेड
कुछ नहीं मिला।
आवश्यकताओं में बदलाव (engines, peer निर्भरताएँ)
| पहले | बाद में | |
|---|---|---|
engines.node | >=4 | — |
इन संस्करणों के बीच का changelog
पैकेज के लेखकों द्वारा प्रकाशित पाठ, जैसा है वैसा दिखाया गया।
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)अपने AI एजेंट को ये तथ्य दें
Vigia एक मुफ़्त MCP सर्वर है: आपका कोडिंग एजेंट कोड लिखने से पहले वर्ज़न, ब्रेकिंग बदलाव और कमज़ोरियाँ जाँचता है। न साइनअप, न API कुंजी।
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Cursor में जोड़ेंVS Code में जोड़ें★ GitHub पर स्टार दें
कोई भी दूसरा MCP क्लाइंट
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }एजेंट स्किल (SKILL.md): एजेंट को बताती है कि Vigia कब इस्तेमाल करना है · पुल रिक्वेस्ट के लिए GitHub Action
अक्सर पूछे जाने वाले प्रश्न
postcss-selector-parser को 6 से 7 पर अपग्रेड करने पर कौन-से असंगत बदलाव हैं?
postcss-selector-parser 6.1.6 और 7.2.1 के बीच Vigia को 1 हटाए गए एक्सपोर्ट, 1 बदले गए सिग्नेचर और 9 हटाए या बदले गए क्लास/इंटरफ़ेस सदस्य मिले।
postcss-selector-parser 7 में क्या डिप्रिकेट हुआ?
postcss-selector-parser 7.2.1 में 0 एक्सपोर्ट या सदस्य नए रूप से डिप्रिकेटेड चिह्नित हैं।
एजेंटों के लिए
GET https://vigia.coredls.cloud/v1/packages/npm/postcss-selector-parser/upgrade?from=6.1.6&to=7.2.1