Skip to content

Commit 5e74837

Browse files
authoredJul 16, 2024··
fix: update TypeScript to v5.5 (#5898)
* chore: bump typescript version in renovate.json to <5.6.0 * chore: update TS to 5.5 * prettier * remove console.log
1 parent d571bbb commit 5e74837

File tree

6 files changed

+10
-27
lines changed

6 files changed

+10
-27
lines changed
 

‎package-lock.json

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
"semver": "^7.3.7",
182182
"terser": "5.31.1",
183183
"tsx": "^4.10.3",
184-
"typescript": "~5.4.0",
184+
"typescript": "~5.5.3",
185185
"webpack": "^5.75.0",
186186
"ws": "8.17.1"
187187
},

‎renovate.json5

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
{
5858
// Increment this value as a part of updating TypeScript
5959
matchPackageNames: ['typescript'],
60-
allowedVersions: '<5.5.0',
60+
allowedVersions: '<5.6.0',
6161
commitMessagePrefix: "feat(typescript):"
6262
},
6363
{
@@ -152,7 +152,7 @@
152152
rebaseWhen: 'never',
153153
/**
154154
* Cron syntax to run at midnight (UTC) on the first day of every month
155-
*
155+
*
156156
* Note: Renovate does not support minute value granularity, so the wildcard value is necessary
157157
*/
158158
schedule: ["* 0 1 * *"],

‎scripts/esbuild/utils/typescript-source.ts

-19
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,6 @@ export async function bundleTypeScriptSource(tsPath: string, opts: BuildOptions)
7474
const jestTypesciptFilename = join(opts.scriptsBuildDir, 'typescript-modified-for-jest.js');
7575
await fs.writeFile(jestTypesciptFilename, code);
7676

77-
// Here we transform the TypeScript source from a commonjs to an ES module.
78-
// We do this so that we can add an import from the `@environment` module.
79-
80-
// trim off the last part that sets module.exports and polyfills globalThis since
81-
// we don't want typescript to add itself to module.exports when in a node env
82-
const tsEnding = `if (typeof module !== "undefined" && module.exports) { module.exports = ts; }`;
83-
84-
if (!code.includes(tsEnding)) {
85-
throw new Error(`"${tsEnding}" not found`);
86-
}
87-
const lastEnding = code.lastIndexOf(tsEnding);
88-
code = code.slice(0, lastEnding);
89-
90-
const o: string[] = [];
91-
o.push(`// TypeScript ${opts.typescriptVersion}`);
92-
o.push(code);
93-
o.push(`export default ts;`);
94-
code = o.join('\n');
95-
9677
// TODO(STENCIL-839): investigate minification issue w/ typescript 5.0
9778
// const { minify } = await import('terser');
9879

‎src/runtime/proxy-component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export const proxyComponent = (
154154
} else if (
155155
prototype.hasOwnProperty(propName) &&
156156
typeof this[propName] === 'number' &&
157-
this[propName] == newValue
157+
// cast type to number to avoid TS compiler issues
158+
this[propName] == (newValue as unknown as number)
158159
) {
159160
// if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
160161
// APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in

‎test/end-to-end/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.