Skip to content

Commit d28d2fd

Browse files
authored
chore(deps): bump @types/estree and parse5 (#5392)
* chore(deps): bump packages with annoying type changes they've been blocking dependabot for ages * chore(types): fix types in template-compiler * chore(deps): pin @types/estree for consistency
1 parent 75e171b commit d28d2fd

File tree

10 files changed

+45
-26
lines changed

10 files changed

+45
-26
lines changed

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@
9898
"resolutions": {
9999
"//": {
100100
"http-cache-semantics": "Pinned to address security vulnerability",
101-
"semver": "Pinned to address security vulnerability"
101+
"semver": "Pinned to address security vulnerability",
102+
"@types/estree": [
103+
"Used by us and our dependencies. Because it's a type definition package,",
104+
"we need everyone to use the same types (mixing versions breaks stuff)."
105+
]
102106
},
103107
"http-cache-semantics": "4.1.1",
104-
"semver": "7.6.0"
108+
"semver": "7.6.0",
109+
"@types/estree": "^1.0.8"
105110
},
106111
"dependencies": {}
107112
}

packages/@lwc/engine-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
"@lwc/shared": "8.20.0",
5252
"@lwc/features": "8.20.0",
5353
"@rollup/plugin-virtual": "^3.0.2",
54-
"parse5": "^7.2.1"
54+
"parse5": "^7.3.0"
5555
}
5656
}

packages/@lwc/ssr-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@
6060
},
6161
"devDependencies": {
6262
"@lwc/babel-plugin-component": "8.20.0",
63-
"@types/estree": "^1.0.7"
63+
"@types/estree": "^1.0.8"
6464
}
6565
}

packages/@lwc/template-compiler/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@
5353
"he": "~1.2.0"
5454
},
5555
"devDependencies": {
56-
"@parse5/tools": "^0.5.0",
57-
"@types/estree": "1.0.7",
56+
"@parse5/tools": "^0.6.0",
57+
"@types/estree": "^1.0.8",
5858
"@types/he": "^1.2.3",
5959
"estree-walker": "~3.0.3",
60-
"parse5": "^7.2.1"
60+
"parse5": "^7.3.0"
6161
}
6262
}

packages/@lwc/template-compiler/src/codegen/codegen.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, salesforce.com, inc.
2+
* Copyright (c) 2025, Salesforce, Inc.
33
* All rights reserved.
44
* SPDX-License-Identifier: MIT
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -65,7 +65,7 @@ import type {
6565
OnDirective,
6666
} from '../shared/types';
6767
import type { APIVersion } from '@lwc/shared';
68-
import type { Node } from 'estree';
68+
import type { Node } from 'estree-walker';
6969

7070
type RenderPrimitive =
7171
| 'iterator'
@@ -666,7 +666,9 @@ export default class CodeGen {
666666
parent.object === node &&
667667
!scope.isLocalIdentifier(node)
668668
) {
669-
this.replace(t.memberExpression(t.identifier(TEMPLATE_PARAMS.INSTANCE), node));
669+
this.replace(
670+
t.memberExpression(t.identifier(TEMPLATE_PARAMS.INSTANCE), node) as Node
671+
);
670672
}
671673
},
672674
});

packages/@lwc/template-compiler/src/codegen/expression.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
isSvgUseHref,
2020
} from '../parser/attribute';
2121
import type { Attribute, BaseElement, ComplexExpression, Property } from '../shared/types';
22-
import type { Node } from 'estree';
22+
import type { Node } from 'estree-walker';
2323
import type CodeGen from './codegen';
2424

2525
type VariableName = string;
@@ -79,7 +79,9 @@ export function bindComplexExpression(
7979
!codeGen.isLocalIdentifier(node) &&
8080
!expressionScopes.isScopedToExpression(node)
8181
) {
82-
this.replace(t.memberExpression(t.identifier(TEMPLATE_PARAMS.INSTANCE), node));
82+
this.replace(
83+
t.memberExpression(t.identifier(TEMPLATE_PARAMS.INSTANCE), node) as Node
84+
);
8385
}
8486
},
8587
});

packages/@lwc/template-compiler/src/codegen/optimize.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import * as astring from 'astring';
88
import { walk } from 'estree-walker';
99
import * as t from '../shared/estree';
10+
import type { Node } from 'estree-walker';
1011

1112
/**
1213
* Given a template function, extract all static objects/arrays (e.g. `{ key : 1 }`)
@@ -88,7 +89,7 @@ export function optimizeStaticExpressions(
8889
return t.identifier(keysToVariableNames.get(key));
8990
}
9091

91-
walk(templateFn, {
92+
walk(templateFn as Node, {
9293
enter(node) {
9394
// For deeply-nested static object, we only want to extract the top-level node
9495
if (isStaticObjectOrArray(node)) {

packages/@lwc/template-compiler/src/parser/expression-complex/validate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import { ParserDiagnostics, invariant } from '@lwc/errors';
99
import { walk } from 'estree-walker';
1010
import * as t from '../../shared/estree';
11-
import type { BaseNode, Node } from 'estree';
11+
import type { BaseNode } from 'estree';
12+
import type { Node } from 'estree-walker';
1213

1314
const ALWAYS_INVALID_TYPES = new Map(
1415
Object.entries({

packages/@lwc/template-compiler/src/parser/html.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { sourceLocation } from '../shared/ast';
1313

1414
import { errorCodesToErrorOn, errorCodesToWarnOnInOlderAPIVersions } from './parse5Errors';
1515
import { parseFragment } from './expression-complex';
16+
import type { DocumentFragment } from '@parse5/tools';
1617
import type ParserCtx from './parser';
1718

1819
function getLwcErrorFromParse5Error(ctx: ParserCtx, code: string) {
@@ -36,7 +37,7 @@ function getLwcErrorFromParse5Error(ctx: ParserCtx, code: string) {
3637
}
3738
}
3839

39-
export function parseHTML(ctx: ParserCtx, source: string) {
40+
export function parseHTML(ctx: ParserCtx, source: string): DocumentFragment {
4041
const onParseError = (err: parse5.ParserError) => {
4142
const { code, ...location } = err;
4243

yarn.lock

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,12 +2275,12 @@
22752275
resolved "https://registry.yarnpkg.com/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-5.0.0.tgz#1575b4aaf6f46faf5b95003be2a5dfd8ea1e10e0"
22762276
integrity sha512-ylppfPEg63NuRXOPNsXFlgyl37JrtRn0QMO26X3K3Ytp5HtLrMreQMGVtgr30e1l2YmAWqhvmKlCryOqzGPD/g==
22772277

2278-
"@parse5/tools@^0.5.0":
2279-
version "0.5.0"
2280-
resolved "https://registry.yarnpkg.com/@parse5/tools/-/tools-0.5.0.tgz#9b5cafd8b5fedc3180823ea5938579216bbeb876"
2281-
integrity sha512-vyYK20atGm9Kwwk/vi5jTFxb7m67EG1PLTUN31+WAUsvgOThu/PjsZD57P6A1hAm2TunkzxSD9esnYv6gcWrdA==
2278+
"@parse5/tools@^0.6.0":
2279+
version "0.6.0"
2280+
resolved "https://registry.yarnpkg.com/@parse5/tools/-/tools-0.6.0.tgz#9fb398bc8a3597892aadcc109a8ccad0a820ad06"
2281+
integrity sha512-T2mU5ZhgPHvwUdiXHweliSVt6mKPNIs3yOitW46LrhUzw/nfde6SaEjOWSXMtdiYKqyxszH2e3Uu/cAMzPi+vg==
22822282
dependencies:
2283-
parse5 "^7.0.0"
2283+
parse5 "^7.3.0"
22842284

22852285
"@pkgjs/parseargs@^0.11.0":
22862286
version "0.11.0"
@@ -2963,12 +2963,7 @@
29632963
dependencies:
29642964
"@types/estree" "*"
29652965

2966-
"@types/estree@*", "@types/[email protected]", "@types/estree@>=1.0.7", "@types/estree@^1.0.0", "@types/estree@^1.0.6", "@types/estree@^1.0.7":
2967-
version "1.0.7"
2968-
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8"
2969-
integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==
2970-
2971-
2966+
"@types/estree@*", "@types/[email protected]", "@types/[email protected]", "@types/estree@>=1.0.7", "@types/estree@^1.0.0", "@types/estree@^1.0.6", "@types/estree@^1.0.8":
29722967
version "1.0.8"
29732968
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e"
29742969
integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==
@@ -6171,6 +6166,11 @@ entities@^4.2.0, entities@^4.5.0:
61716166
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
61726167
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
61736168

6169+
entities@^6.0.0:
6170+
version "6.0.1"
6171+
resolved "https://registry.yarnpkg.com/entities/-/entities-6.0.1.tgz#c28c34a43379ca7f61d074130b2f5f7020a30694"
6172+
integrity sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==
6173+
61746174
env-paths@^2.2.0, env-paths@^2.2.1:
61756175
version "2.2.1"
61766176
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2"
@@ -10508,6 +10508,13 @@ parse5@^7.0.0, parse5@^7.1.2, parse5@^7.2.1:
1050810508
dependencies:
1050910509
entities "^4.5.0"
1051010510

10511+
parse5@^7.3.0:
10512+
version "7.3.0"
10513+
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.3.0.tgz#d7e224fa72399c7a175099f45fc2ad024b05ec05"
10514+
integrity sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==
10515+
dependencies:
10516+
entities "^6.0.0"
10517+
1051110518
parseurl@^1.3.2, parseurl@~1.3.3:
1051210519
version "1.3.3"
1051310520
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"

0 commit comments

Comments
 (0)