Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting.
diff --git a/packages/documentation/copy/en/release-notes/TypeScript 6.0.md b/packages/documentation/copy/en/release-notes/TypeScript 6.0.md
new file mode 100644
index 000000000..4523b88fb
--- /dev/null
+++ b/packages/documentation/copy/en/release-notes/TypeScript 6.0.md
@@ -0,0 +1,785 @@
+---
+title: TypeScript 6.0
+layout: docs
+permalink: /docs/handbook/release-notes/typescript-6-0.html
+oneline: TypeScript 6.0 Release Notes
+---
+
+## Less Context-Sensitivity on `this`-less Functions
+
+When parameters don't have explicit types written out, TypeScript can usually infer them based on an expected type, or even through other arguments in the same function call.
+
+```ts
+declare function callIt(obj: {
+ produce: (x: number) => T,
+ consume: (y: T) => void,
+}): void;
+
+// Works, no issues.
+callIt({
+ produce: (x: number) => x * 2,
+ consume: y => y.toFixed(),
+});
+
+// Works, no issues even though the order of the properties is flipped.
+callIt({
+ consume: y => y.toFixed(),
+ produce: (x: number) => x * 2,
+});
+```
+
+Here, TypeScript can infer the type of `y` in the `consume` function based on the inferred `T` from the `produce` function, regardless of the order of the properties.
+But what about if these functions were written using *method syntax* instead of arrow function syntax?
+
+```ts
+declare function callIt(obj: {
+ produce: (x: number) => T,
+ consume: (y: T) => void,
+}): void;
+
+// Works fine, `x` is inferred to be a number.
+callIt({
+ produce(x: number) { return x * 2; },
+ consume(y) { return y.toFixed(); },
+});
+
+callIt({
+ consume(y) { return y.toFixed(); },
+ // ~
+ // error: 'y' is of type 'unknown'.
+
+ produce(x: number) { return x * 2; },
+});
+```
+
+Strangely enough, the second call to `callIt` results in an error because TypeScript is not able to infer the type of `y` in the `consume` method.
+What's happening here is that when TypeScript is trying to find candidates for `T`, it will first skip over functions whose parameters don't have explicit types.
+It does this because certain functions may need the inferred type of `T` to be correctly checked - in our case, we need to know the type of `T` to analyze our `consume` function.
+
+These functions are called *contextually sensitive functions* - basically, functions that have parameters without explicit types.
+Eventually the type system will need to figure out types for these parameters - but this is a bit at odds with how inference works in generic functions because the two "pull" on types in different directions.
+
+```ts
+function callFunc(callback: (x: T) => void, value: T) {
+ return callback(value);
+}
+
+callFunc(x => x.toFixed(), 42);
+// ^
+// We need to figure out the type of `x` here,
+// but we also need to figure out the type of `T` to check the callback.
+```
+
+To solve this, TypeScript skips over contextually sensitive functions during type argument inference, and instead checks and infers from other arguments first.
+If skipping over contextually sensitive functions doesn't work, inference just continues across any unchecked arguments, going left-to-right in the argument list.
+In the example immediately above, TypeScript will skip over the callback during inference for `T`, but will then look at the second argument, `42`, and infer that `T` is `number`.
+Then, when it comes back to check the callback, it will have a contextual type of `(x: number) => void`, which allows it to infer that `x` is a `number` as well.
+
+So what's going on in our earlier examples?
+
+```ts
+// Arrow syntax - no errors.
+callIt({
+ consume: y => y.toFixed(),
+ produce: (x: number) => x * 2,
+});
+
+// Method syntax - errors!
+callIt({
+ consume(y) { return y.toFixed(); },
+ // ~
+ // error: 'y' is of type 'unknown'.
+
+ produce(x: number) { return x * 2; },
+});
+```
+
+In both examples, `produce` is assigned a function with an explicitly-typed `x` parameter.
+Shouldn't they be checked identically?
+
+The issue is subtle: most functions (like the ones using method syntax) have an implicit `this` parameter, but arrow functions do not.
+Any usage of `this` could require "pulling" on the type of `T` - for example, knowing the type of the containing object literal could in turn require the type of `consume`, which uses `T`.
+
+But we're not using `this`!
+Sure, the function might have a `this` value at runtime, but it's never used!
+
+TypeScript 6.0 takes this into account when it decides if a function is contextually sensitive or not.
+If `this` is never actually *used* in a function, then it is not considered contextually sensitive.
+That means these functions will be seen as higher-priority when it comes to type inference, and all of our examples above now work!
+
+[This change was provided](https://github.com/microsoft/TypeScript/pull/62243) thanks to the work of [Mateusz Burzyński](https://github.com/Andarist).
+
+## Subpath Imports Starting with `#/`
+
+When Node.js added support for modules, it added a feature called ["subpath imports"](https://nodejs.org/api/packages.html#subpath-imports).
+This is basically [a field called `imports`](https://nodejs.org/api/packages.html#imports) which allows packages to create internal aliases for modules within their package.
+
+```json
+{
+ "name": "my-package",
+ "type": "module",
+ "imports": {
+ "#root/*": "./dist/*"
+ }
+}
+```
+
+This allows modules in `my-package` to import from paths starting with `#root/`
+
+```js
+import * as utils from "#root/utils.js";
+```
+
+instead of using a relative path like the following.
+
+```js
+import * as utils from "../../utils.js";
+```
+
+One minor annoyance with this feature has been that developers always had to write *something* after the `#` when specifying a subpath import.
+Here, we used `root`, but it is a bit useless since there is no directory we're mapping over other than `./dist/`
+
+Developers who have used bundlers are also accustomed to using path-mapping to avoid long relative paths.
+A familiar convention with bundlers has been to use a simple `@/` as the prefix.
+Unfortunately, subpath imports could not start with `#/` at all, leading to a lot of confusion for developers trying to adopt them in their projects.
+
+But more recently, [Node.js added support for subpath imports starting with `#/`](https://github.com/nodejs/node/pull/60864).
+This allows packages to use a simple `#/` prefix for their subpath imports without needing to add an extra segment.
+
+```json
+{
+ "name": "my-package",
+ "type": "module",
+ "imports": {
+ "#/*": "./dist/*"
+ }
+}
+```
+
+This is supported in newer Node.js 20 releases, and so TypeScript now supports it under the options `nodenext` and `bundler` for the `--moduleResolution` setting.
+
+This work was done thanks to [magic-akari](https://github.com/magic-akari), and [the implementing pull request can be found here](https://github.com/microsoft/TypeScript/pull/62844).
+
+## Combining `--moduleResolution bundler` with `--module commonjs`
+
+TypeScript's `--moduleResolution bundler` setting was previously only allowed to be used with `--module esnext` or `--module preserve`;
+however, with the deprecation of `--moduleResolution node` (a.k.a. `--moduleResolution node10`), this new combination is often the most suitable upgrade path for many projects.
+
+Projects will often want to instead plan out a migration towards either
+
+* `--module preserve` and `--moduleResolution bundler`
+* `--module nodenext`
+
+depending on your project type (e.g. bundled web app, Bun app, or Node.js app).
+
+More information can be found at [this implementing pull request](https://github.com/microsoft/TypeScript/pull/62320).
+
+## The `--stableTypeOrdering` Flag
+
+As part of our ongoing work on [TypeScript's native port](https://devblogs.microsoft.com/typescript/typescript-native-port/), we've introduced a new flag called `--stableTypeOrdering` intended to assist with 6.0-to-7.0 migrations.
+
+Today, TypeScript assigns type IDs (internal tracking numbers) to types in the order they are encountered, and uses these IDs to sort union types in a consistent manner.
+A similar process occurs for properties.
+As a result, the order in which things are declared in a program can have possibly surprising effects on things like declaration emit.
+
+For example, consider the declaration emit from this file:
+```ts
+// Input: some-file.ts
+export function foo(condition: boolean) {
+ return condition ? 100 : 500;
+}
+
+// Output: some-file.d.ts
+export declare function foo(condition: boolean): 100 | 500;
+// ^^^^^^^^^
+// Note the order of this union: 100, then 500.
+```
+
+If we add an unrelated `const` *above* `foo`, the declaration emit changes:
+
+```ts
+// Input: some-file.ts
+const x = 500;
+export function foo(condition: boolean) {
+ return condition ? 100 : 500;
+}
+
+// Output: some-file.d.ts
+export declare function foo(condition: boolean): 500 | 100;
+// ^^^^^^^^^
+// Note the change in order here.
+```
+
+This happens because the literal type `500` gets a lower type ID than `100` because it was processed first when analyzing the `const x` declaration.
+In very rare cases this change in ordering can even cause errors to appear or disappear based on program processing order, but in general, the main place you might notice this ordering is in the emitted declaration files, or in the way types are displayed in your editor.
+
+One of the major architectural improvements in TypeScript 7 is parallel type checking, which dramatically improves overall check time.
+However, parallelism introduces a challenge: when different type-checkers visit nodes, types, and symbols in different orders, the internal IDs assigned to these constructs become non-deterministic.
+This in turn leads to confusing non-deterministic output, where two files with identical contents in the same program can produce different declaration files, or even calculate different errors when analyzing the same file.
+To fix this, TypeScript 7.0 sorts its internal objects (e.g. types and symbols) according to a deterministic algorithm based on the content of the object.
+This ensures that all checkers encounter the same object order regardless of how and when they were created.
+As a consequence, in the given example, TypeScript 7 will *always* print `100 | 500`, removing the ordering instability entirely.
+
+This means that TypeScript 6 and 7 can and do sometimes display different ordering.
+While these ordering changes are almost always benign, if you're comparing compiler outputs between runs (for example, checking emitted declaration files in 6.0 vs 7.0), these different orderings can produce a lot of noise that makes it difficult to assess correctness.
+Occasionally though, you may witness a change in ordering that causes a type error to appear or disappear, which can be even more confusing.
+
+To help with this situation, in 6.0, you can specify the new `--stableTypeOrdering` flag.
+This makes 6.0's type ordering behavior match 7.0's, reducing the number of differences between the two codebases.
+Note that we don't necessarily encourage using this flag all the time as it can add a substantial slowdown to type-checking (up to 25% depending on codebase).
+
+If you encounter a type error using `--stableTypeOrdering`, this is typically due to inference differences.
+The previous inference without `--stableTypeOrdering` *happened* to work based on the current ordering of types in your program.
+To help with this, you'll often benefit from providing an explicit type somewhere.
+Often, this will be a type argument
+
+```diff
+- someFunctionCall(/*...*/);
++ someFunctionCall(/*...*/);
+```
+
+or a variable annotation for an argument you intend to pass into a call.
+
+```diff
+- const someVariable = { /*... some complex object ...*/ };
++ const someVariable: SomeExplicitType = { /*... some complex object ...*/ };
+
+someFunctionCall(someVariable);
+```
+
+**Note that this flag is only intended to help diagnose differences between 6.0 and 7.0 - it is not intended to be used as a long-term feature**
+
+[See more at this pull-request](https://github.com/microsoft/TypeScript/pull/63084).
+
+## `es2025` option for `target` and `lib`
+
+TypeScript 6.0 adds support for the `es2025` option for both `target` and `lib`.
+While there are no new JavaScript language features in ES2025, this new target adds new types for built-in APIs (e.g. `RegExp.escape`), and moves a few declarations from `esnext` into `es2025` (e.g. `Promise.try`, `Iterator` methods, and `Set` methods).
+Work to enable [the new target](https://github.com/microsoft/TypeScript/pull/63046) was contributed thanks to [Kenta Moriuchi](https://github.com/petamoriken).
+
+## New Types for `Temporal`
+
+The long-awaited [Temporal proposal](https://github.com/tc39/proposal-temporal) has reached stage 4 and will be part of a future ECMAScript standard.
+TypeScript 6.0 now includes built-in types for the Temporal API, so you can start using it in your TypeScript code today via `--target esnext` or `"lib": ["esnext"]` (or the more-granular `esnext.temporal`).
+
+```ts
+let yesterday = Temporal.Now.instant().subtract({
+ hours: 24,
+});
+
+let tomorrow = Temporal.Now.instant().add({
+ hours: 24,
+});
+
+console.log(`Yesterday: ${yesterday}`);
+console.log(`Tomorrow: ${tomorrow}`);
+```
+
+Temporal is already usable in several runtimes, and with stage 4 status it is now officially part of the JavaScript language.
+[Documentation on the Temporal APIs is available on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal).
+
+[This work](https://github.com/microsoft/TypeScript/pull/62628) was contributed thanks to GitHub user [Renegade334](https://github.com/Renegade334).
+
+## New Types for "upsert" Methods (a.k.a. `getOrInsert`)
+
+A common pattern with `Map`s is to check if a key exists, and if not, set and fetch a default value.
+
+```ts
+function processOptions(compilerOptions: Map) {
+ let strictValue: unknown;
+ if (compilerOptions.has("strict")) {
+ strictValue = compilerOptions.get("strict");
+ }
+ else {
+ strictValue = true;
+ compilerOptions.set("strict", strictValue);
+ }
+ // ...
+}
+```
+
+This pattern can be tedious.
+[ECMAScript's "upsert" proposal](https://github.com/tc39/proposal-upsert) recently reached stage 4, and introduces 2 new methods on `Map` and `WeakMap`:
+
+- `getOrInsert`
+- `getOrInsertComputed`
+
+These methods have been added to the `esnext` lib so that you can start using them immediately in TypeScript 6.0.
+
+With `getOrInsert`, we can replace our code above with the following:
+
+```ts
+function processOptions(compilerOptions: Map) {
+ let strictValue = compilerOptions.getOrInsert("strict", true);
+ // ...
+}
+```
+
+`getOrInsertComputed` works similarly, but is for cases where the default value may be expensive to compute (e.g. requires lots of computations, allocations, or does long-running synchronous I/O).
+Instead, it takes a callback that will only be called if the key is not already present.
+
+```ts
+someMap.getOrInsertComputed("someKey", () => {
+ return computeSomeExpensiveValue(/*...*/);
+});
+```
+
+This callback is also given the key as an argument, which can be useful for cases where the default value is based on the key.
+
+```ts
+someMap.getOrInsertComputed(someKey, computeSomeExpensiveDefaultValue);
+
+function computeSomeExpensiveValue(key: string) {
+ // ...
+}
+```
+
+[This update](https://github.com/microsoft/TypeScript/pull/62612) was contributed thanks to GitHub user [Renegade334](https://github.com/Renegade334).
+
+## `RegExp.escape`
+
+When constructing some literal string to match within a regular expression, it is important to escape special regular expression characters like `*`, `+`, `?`, `(`, `)`, etc.
+The [RegExp Escaping ECMAScript proposal](https://github.com/tc39/proposal-regex-escaping) has reached stage 4, and introduces a new `RegExp.escape` function that takes care of this for you.
+
+```ts
+function matchWholeWord(word: string, text: string) {
+ const escapedWord = RegExp.escape(word);
+ const regex = new RegExp(`\\b${escapedWord}\\b`, "g");
+ return text.match(regex);
+}
+```
+
+`RegExp.escape` is available in the `es2025` lib, so you can start using it in TypeScript 6.0 today.
+
+[This work](https://github.com/microsoft/TypeScript/pull/63046) was contributed thanks [Kenta Moriuchi](https://github.com/petamoriken).
+
+## The `dom` lib Now Contains `dom.iterable` and `dom.asynciterable`
+
+TypeScript's `lib` option allows you to specify which global declarations your target runtime has.
+One option is `dom` to represent web environments (i.e. browsers, who implement [the DOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)).
+Previously, the DOM APIs were partially split out into `dom.iterable` and `dom.asynciterable` for environments that didn't support `Iterable`s and `AsyncIterable`s.
+This meant that you had to explicitly add `dom.iterable` to use iteration methods on DOM collections like `NodeList` or `HTMLCollection`.
+
+In TypeScript 6.0, the contents of `lib.dom.iterable.d.ts` and `lib.dom.asynciterable.d.ts` are fully included in `lib.dom.d.ts`.
+You can still reference `dom.iterable` and `dom.asynciterable` in your configuration file's `"lib"` array, but they are now just empty files.
+
+```ts
+// Before TypeScript 6.0, this required "lib": ["dom", "dom.iterable"]
+// Now it works with just "lib": ["dom"]
+for (const element of document.querySelectorAll("div")) {
+ console.log(element.textContent);
+}
+```
+
+This is a quality-of-life improvement that eliminates a common point of confusion, since no major modern browser lacks these capabilities.
+If you were already including both `dom` and `dom.iterable`, you can now simplify to just `dom`.
+
+See more [at this issue](https://github.com/microsoft/TypeScript/issues/60959) and its [corresponding pull request](https://github.com/microsoft/TypeScript/pull/62111).
+
+## Breaking Changes and Deprecations in TypeScript 6.0
+
+TypeScript 6.0 arrives as a significant transition release, designed to prepare developers for TypeScript 7.0, the upcoming native port of the TypeScript compiler.
+While TypeScript 6.0 maintains full compatibility with your existing TypeScript knowledge and continues to be API compatible with TypeScript 5.9, this release introduces a number of breaking changes and deprecations that reflect the evolving JavaScript ecosystem and set the stage for TypeScript 7.0.
+
+In the two years since TypeScript 5.0, we've seen ongoing shifts in how developers write and ship JavaScript:
+
+- Virtually every runtime environment is now "evergreen". True legacy environments (ES5) are vanishingly rare.
+- Bundlers and ESM have become the most common module targets for new projects, though CommonJS remains a major target. AMD and other in-browser userland module systems are much rarer than they were in 2012.
+- Almost all packages can be consumed through some module system. UMD packages still exist, but virtually no new code is available *only* as a global variable.
+- `tsconfig.json` is nearly universal as a configuration mechanism.
+- Appetite for "stricter" typing continues to grow.
+- TypeScript build performance is top of mind. Despite the gains of TypeScript 7, performance must always remain a key goal, and options which can't be supported in a performant way need to be more strongly justified.
+
+So TypeScript 6.0 and 7.0 are designed with these realities in mind.
+For TypeScript 6.0, these deprecations can be ignored by setting `"ignoreDeprecations": "6.0"` in your tsconfig; however, note that TypeScript 7.0 *will not* support any of these deprecated options.
+
+Some necessary adjustments can be automatically performed with a codemod or tool.
+For example, the [experimental `ts5to6` tool](https://github.com/andrewbranch/ts5to6) can automatically adjust `baseUrl` and `rootDir` across your codebase.
+
+### Up-Front Adjustments
+
+We'll cover specific adjustments below, but we have to note that some deprecations and behavior changes do not necessarily have an error message that directly points to the underlying issue.
+So we'll note up-front that **many projects will need to do at least one of the following**:
+
+* Set the `"types"` array in tsconfig, typically to `"types": ["node"]`.
+
+ `"types": ["*"]` will restore the 5.9 behavior, but we recommend using an explicit array to improve build performance and predictability.
+
+ You'll typically know this is the issue if you see a *lot* of type errors related to missing identifiers or unresolved built-in modules.
+* Set `"rootDir": "./src"` if you were previously relying on this being inferred
+
+ You'll often know this is the issue if you see files being written to `./dist/src/index.js` instead of `./dist/index.js`.
+
+### Simple Default Changes
+
+Several compiler options now have updated default values that better reflect modern development practices.
+
+- **`strict` is now `true` by default**:
+ The appetite for stricter typing continues to grow, and we've found that most new projects want `strict` mode enabled.
+ If you were already using `"strict": true`, nothing changes for you.
+ If you were relying on the previous default of `false`, you'll need to explicitly set `"strict": false` in your `tsconfig.json`.
+
+- **`module` defaults to `esnext`**:
+ Similarly, the new default `module` is `esnext`, acknowledging that ESM is now the dominant module format.
+
+- **`target` defaults to current-year ES version**:
+ The new default `target` is the most recent supported ECMAScript spec version (effectively a floating target).
+ Right now, that target is `es2025`.
+ This reflects the reality that most developers are shipping to evergreen runtimes and don't need to compile down to older ECMAScript versions.
+
+- **`noUncheckedSideEffectImports` is now `true` by default**:
+ This helps catch issues with typos in side-effect-only imports.
+
+- **`libReplacement` is now `false` by default**:
+ This flag previously incurred a large number of failed module resolutions for every run, which in turn increased the number of locations we needed to watch under `--watch` and editor scenarios.
+ In a new project, `libReplacement` never does anything until other explicit configuration takes place, so it makes sense to turn this off by default for the sake of better performance by default.
+
+If these new defaults break your project, you can specify the previous values explicitly in your `tsconfig.json`.
+
+### `rootDir` now defaults to `.`
+
+`rootDir` controls the directory structure of your output files relative to the output directory.
+Previously, if you did not specify a `rootDir`, it was inferred based on the common directory of all non-declaration input files.
+But this often meant that it was impossible to know if a file belonged to a project without trying to load and parse that project.
+It also meant that TypeScript had to spend more time inferring that common source directory by analyzing every file path in the program.
+
+In TypeScript 6.0, the default `rootDir` will always be the directory containing the `tsconfig.json` file.
+`rootDir` will only be inferred when using `tsc` from the command line without a `tsconfig.json` file.
+
+If you have source files any level deeper than your `tsconfig.json` directory and were relying on TypeScript to infer a common root directory for source files, you'll need to explicitly set `rootDir`:
+
+```diff
+ {
+ "compilerOptions": {
+ // ...
++ "rootDir": "./src"
+ },
+ "include": ["./src"]
+ }
+```
+
+Likewise, if your `tsconfig.json` referenced files outside of the containing `tsconfig.json`, you would need to adjust your `rootDir` to include those files.
+
+```diff
+ {
+ "compilerOptions": {
+ // ...
++ "rootDir": "../src"
+ },
+ "include": ["../src/**/*.tests.ts"]
+ }
+```
+
+See more at [the discussion here](https://github.com/microsoft/TypeScript/issues/62194) and [the implementation here](https://github.com/microsoft/TypeScript/pull/62418).
+
+### `types` now defaults to `[]`
+
+In a `tsconfig.json`, the `types` field of `compilerOptions` specifies a list of package names to be included in the global scope during compilation.
+Typically, packages in `node_modules` are automatically included via imports in your source code;
+but for convenience, TypeScript would also include all packages in `node_modules/@types` by default, so that you can get global declarations like `process` or the `"fs"` module from `@types/node`, or `describe` and `it` from `@types/jest`, without needing to import them directly.
+
+In a sense, the `types` value previously defaulted to "enumerate everything in `node_modules/@types`".
+This can be *very* expensive, as a normal repository setup these days might transitively pull in hundreds of `@types` packages, especially in multi-project workspaces with flattened `node_modules`.
+Modern projects almost always need only `@types/node`, `@types/jest`, or a handful of other common global-affecting packages.
+
+In TypeScript 6.0, the default `types` value will be `[]` (an empty array).
+This change prevents projects from unintentionally pulling in hundreds or even thousands of unneeded declaration files at build time.
+Many projects we've looked at have improved their build time anywhere from 20-50% just by setting `types` appropriately.
+
+**This will affect many projects.** You will likely need to add `"types": ["node"]` or a few others:
+
+```diff
+ {
+ "compilerOptions": {
+ // Explicitly list the @types packages you need
++ "types": ["node", "jest"]
+ }
+ }
+```
+
+You can also specify a `*` entry to re-enable the old enumeration behavior:
+
+```diff
+ {
+ "compilerOptions": {
+ // Load ALL the types - the default from TypeScript 5.9 and before.
++ "types": ["*"]
+ }
+ }
+```
+
+If you end up with new error messages like the following:
+
+```
+Cannot find module '...' or its corresponding type declarations.
+Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
+Cannot find name 'path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
+Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
+Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig.
+Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
+```
+
+it's likely that you need to add some entries to your `types` field.
+
+See more at [the proposal here](https://github.com/microsoft/TypeScript/issues/62195) along with [the implementing pull request here](https://github.com/microsoft/TypeScript/pull/63054).
+
+### Deprecated: `target: es5`
+
+The ECMAScript 5 target was important for a long time to support legacy browsers; but its successor, ECMAScript 2015 (ES6), was released over a decade ago, and all modern browsers have supported it for many years.
+With Internet Explorer's retirement, and the universality of evergreen browsers, there are very few use cases for ES5 output today.
+
+TypeScript's lowest target will now be ES2015, and the `target: es5` option is deprecated. If you were using `target: es5`, you'll need to migrate to a newer target or use an external compiler.
+If you still need ES5 output, we recommend using an external compiler to either directly compile your TypeScript source, or to post-process TypeScript's outputs.
+
+[See more about this deprecation here](https://github.com/microsoft/TypeScript/issues/62196) along with [its implementing pull request](https://github.com/microsoft/TypeScript/pull/63067).
+
+### Deprecated: `--downlevelIteration`
+
+`--downlevelIteration` only has effects on ES5 emit, and since `--target es5` has been deprecated, `--downlevelIteration` no longer serves a purpose.
+
+Subtly, using `--downlevelIteration false` with `--target es2015` did not error in TypeScript 5.9 and earlier, even though it had no effect.
+In TypeScript 6.0, setting `--downlevelIteration` at all will lead to a deprecation error.
+
+See [the implementation here](https://github.com/microsoft/TypeScript/pull/63071).
+
+### Deprecated: `--moduleResolution node` (a.k.a. `--moduleResolution node10`)
+
+`--moduleResolution node` encoded a specific version of Node.js's module resolution algorithm that most-accurately reflected the behavior of Node.js 10.
+Unfortunately, this target (and its name) ignores many updates to Node.js's resolution algorithm that have occurred since then, and it is no longer a good representation of the behavior of modern Node.js versions.
+
+In TypeScript 6.0, `--moduleResolution node` (specifically, `--moduleResolution node10`) is deprecated.
+Users who were using `--moduleResolution node` should usually migrate to `--moduleResolution nodenext` if they plan on targeting Node.js directly, or `--moduleResolution bundler` if they plan on using a bundler or Bun.
+
+See more [at this issue](https://github.com/microsoft/TypeScript/issues/62200) and [its corresponding pull request](https://github.com/microsoft/TypeScript/pull/62338).
+
+### Deprecated: `amd`, `umd`, and `systemjs` values of `module`
+
+The following flag values are no longer supported
+
+- `--module amd`
+- `--module umd`
+- `--module systemjs`
+- `--module none`
+
+AMD, UMD, and SystemJS were important during the early days of JavaScript modules when browsers lacked native module support.
+The semantics of "none" were never well-defined and often led to confusion.
+Today, ESM is universally supported in browsers and Node.js, and both import maps and bundlers have become favored ways for filling in the gaps.
+If you're still targeting these module systems, consider migrating to an appropriate ECMAScript module-emitting target, adopt a bundler or different compiler, or stay on TypeScript 5.x until you can migrate.
+
+This also implies dropped support for the `amd-module` directive, which will no longer have any effect.
+
+See more at [the proposal issue](https://github.com/microsoft/TypeScript/issues/62199) along with [the implementing pull request](https://github.com/microsoft/TypeScript/pull/62669).
+
+### Deprecated: `--baseUrl`
+
+The `baseUrl` option is most-commonly used in conjunction with `paths`, and is typically used as a prefix for every value in `paths`.
+Unfortunately, `baseUrl` is also considered a look-up root for module resolution.
+
+For example, given the following `tsconfig.json`
+
+```json5
+{
+ "compilerOptions": {
+ // ...
+ "baseUrl": "./src",
+ "paths": {
+ "@app/*": ["app/*"],
+ "@lib/*": ["lib/*"]
+ }
+ }
+}
+```
+
+and an import like
+
+```ts
+import * as someModule from "someModule.js";
+```
+
+TypeScript will probably resolve this to `src/someModule.js`, even if the developer only intended to add mappings for modules starting with `@app/` and `@lib/`.
+
+In the best case, this also often leads to "worse-looking" paths that bundlers would ignore;
+but it often meant that that many import paths that would never have worked at runtime are considered "just fine" by TypeScript.
+
+`path` mappings have not required specifying `baseUrl` for a long time, and in practice, most projects that use `baseUrl` only use it as a prefix for their `paths` entries.
+In TypeScript 6.0, `baseUrl` is deprecated and will no longer be considered a look-up root for module resolution.
+
+Developers who used `baseUrl` as a prefix for path-mapping entries can simply remove `baseUrl` and add the prefix to their `paths` entries:
+
+```diff json5
+ {
+ "compilerOptions": {
+ // ...
+- "baseUrl": "./src",
+ "paths": {
+- "@app/*": ["app/*"],
+- "@lib/*": ["lib/*"]
++ "@app/*": ["./src/app/*"],
++ "@lib/*": ["./src/lib/*"]
+ }
+ }
+ }
+```
+
+Developers who actually *did* use `baseUrl` as a look-up root can also add an explicit path mapping to preserve the old behavior:
+
+```json5
+{
+ "compilerOptions": {
+ // ...
+ "paths": {
+ // A new catch-all that replaces the baseUrl:
+ "*": ["./src/*"],
+
+ // Every other path now has an explicit common prefix:
+ "@app/*": ["./src/app/*"],
+ "@lib/*": ["./src/lib/*"],
+ }
+ }
+}
+```
+
+However, this is extremely rare.
+We recommend most developers simply remove `baseUrl` and add the appropriate prefixes to their `paths` entries.
+
+See more [at this issue](https://github.com/microsoft/TypeScript/issues/62207) and [the corresponding pull request](https://github.com/microsoft/TypeScript/pull/62509).
+
+### Deprecated: `--moduleResolution classic`
+
+The `moduleResolution: classic` setting has been removed.
+The `classic` resolution strategy was TypeScript's original module resolution algorithm, and predates Node.js's resolution algorithm becoming a de facto standard.
+Today, all practical use cases are served by `nodenext` or `bundler`.
+If you were using `classic`, migrate to one of these modern resolution strategies.
+
+See more at [this issue](https://github.com/microsoft/TypeScript/issues/62206) and [the implementing pull request](https://github.com/microsoft/TypeScript/pull/62669).
+
+### Deprecated: `--esModuleInterop false` and `--allowSyntheticDefaultImports false`
+
+The following settings can no longer be set to `false`:
+
+- `esModuleInterop`
+- `allowSyntheticDefaultImports`
+
+`esModuleInterop` and `allowSyntheticDefaultImports` were originally opt-in to avoid breaking existing projects.
+However, the behavior they enable has been the recommended default for years.
+Setting them to `false` often led to subtle runtime issues when consuming CommonJS modules from ESM.
+In TypeScript 6.0, the safer interop behavior is always enabled.
+
+If you have imports that rely on the old behavior, you may need to adjust them:
+
+```ts
+// Before (with esModuleInterop: false)
+import * as express from "express";
+
+// After (with esModuleInterop always enabled)
+import express from "express";
+```
+
+See more at [this issue](https://github.com/microsoft/TypeScript/issues/62529) and [its implementing pull request](https://github.com/microsoft/TypeScript/pull/62567).
+
+### Deprecated: `--alwaysStrict false`
+
+The `alwaysStrict` flag refers to inference and emit of the `"use strict";` directive.
+In TypeScript 6.0, all code will be assumed to be in [JavaScript strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode), which is a set of JS semantics that most-noticeably affects syntactic corner cases around reserved words.
+If you have "sloppy mode" code that uses reserved words like `await`, `static`, `private`, or `public` as regular identifiers, you'll need to rename them.
+If you relied on subtle semantics around the meaning of `this` in non-strict code, you may need to adjust your code as well.
+
+See more [at this issue](https://github.com/microsoft/TypeScript/issues/62213) and [its corresponding pull request](https://github.com/microsoft/TypeScript/pull/63089).
+
+### Deprecated: `outFile`
+
+The `--outFile` option has been removed from TypeScript 6.0. This option was originally designed to concatenate multiple input files into a single output file. However, external bundlers like Webpack, Rollup, esbuild, Vite, Parcel, and others now do this job faster, better, and with far more configurability. Removing this option simplifies the implementation and allows us to focus on what TypeScript does best: type-checking and declaration emit. If you're currently using `--outFile`, you'll need to migrate to an external bundler. Most modern bundlers have excellent TypeScript support out of the box.
+
+### Deprecated: legacy `module` Syntax for namespaces
+
+Early versions of TypeScript used the `module` keyword to declare namespaces:
+
+```ts
+// ❌ Deprecated syntax - now an error
+module Foo {
+ export const bar = 10;
+}
+```
+
+This syntax was later aliased to the modern preferred form using the `namespace` keyword:
+
+```ts
+// ✅ The correct syntax
+namespace Foo {
+ export const bar = 10;
+}
+```
+
+When `namespace` was introduced, the `module` syntax was simply discouraged.
+A few years ago, the TypeScript language service started marking the keyword as deprecated, suggesting `namespace` in its place.
+
+In TypeScript 6.0, using `module` where `namespace` is expected is now a hard deprecation.
+This change is necessary because `module` blocks are a potential ECMAScript proposal that would conflict with the legacy TypeScript syntax.
+
+The ambient module declaration form remains fully supported:
+
+```ts
+// ✅ Still works perfectly
+declare module "some-module" {
+ export function doSomething(): void;
+}
+```
+
+See [this issue](https://github.com/microsoft/TypeScript/issues/62211) and its [corresponding pull request](https://github.com/microsoft/TypeScript/pull/62876) for more details.
+
+### Deprecated: `asserts` Keyword on Imports
+
+The `asserts` keyword was proposed to the JavaScript language via the import assertions proposal;
+however, the proposal eventually morphed into [the import attributes proposal](https://github.com/tc39/proposal-import-attributes), which uses the `with` keyword instead of `asserts`.
+
+Thus, the `asserts` syntax is now deprecated in TypeScript 6.0, and using it will lead to an error:
+
+```ts
+// ❌ Deprecated syntax - now an error.
+import blob from "./blahb.json" asserts { type: "json" }
+// ~~~~~~~
+// error: Import assertions have been replaced by import attributes. Use 'with' instead of 'asserts'.
+```
+
+Instead, use the `with` syntax for import attributes:
+
+```ts
+// ✅ Works with the new import attributes syntax.
+import blob from "./blahb.json" with { type: "json" }
+```
+
+See more at [this issue](https://github.com/microsoft/TypeScript/issues/62210) and its [corresponding pull request](https://github.com/microsoft/TypeScript/pull/63077).
+
+
+### Deprecated: `no-default-lib` Directives
+
+The `/// ` directive has been largely misunderstood and misused.
+In TypeScript 6.0, this directive is no longer supported.
+If you were using it, consider using `--noLib` or `--libReplacement` instead.
+
+[See more here](https://github.com/microsoft/TypeScript/issues/62209) and at [the corresponding pull request](https://github.com/microsoft/TypeScript/pull/62435).
+
+### Specifying Command-Line Files When `tsconfig.json` Exists is Now an Error
+
+Currently, if you run `tsc foo.ts` in a folder where a `tsconfig.json` exists, the config file is completely ignored.
+This was often very confusing if you expected checking and emit options to apply to the input file.
+
+In TypeScript 6.0, if you run `tsc` with file arguments in a directory containing a `tsconfig.json`, an error will be issued to make this behavior explicit:
+
+```
+error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.
+```
+
+If it is the case that you wanted to ignore the `tsconfig.json` and just compile `foo.ts` with TypeScript's defaults, you can use the new `--ignoreConfig` flag.
+
+```sh
+tsc --ignoreConfig foo.ts
+```
+
+See more [at this issue](https://github.com/microsoft/TypeScript/issues/62197) and its [corresponding pull request](https://github.com/microsoft/TypeScript/pull/62477).
+
+## Preparing for TypeScript 7.0
+
+TypeScript 6.0 is designed as a transition release.
+While options deprecated in TypeScript 6.0 will continue to work without errors when `"ignoreDeprecations": "6.0"` is set, those options will be **removed entirely in TypeScript 7.0** (the native TypeScript port).
+If you're seeing deprecation warnings after upgrading to TypeScript 6.0, we strongly recommend addressing them before adopting TypeScript 7.0 (or trying [native previews](https://www.npmjs.com/package/@typescript/native-preview)) in your project.
diff --git a/packages/documentation/scripts/types/AllFilenames.d.ts b/packages/documentation/scripts/types/AllFilenames.d.ts
index bc06bcfe1..c91226c7b 100644
--- a/packages/documentation/scripts/types/AllFilenames.d.ts
+++ b/packages/documentation/scripts/types/AllFilenames.d.ts
@@ -132,6 +132,7 @@ export type AllDocsPages =
| "release-notes/TypeScript 5.7.md"
| "release-notes/TypeScript 5.8.md"
| "release-notes/TypeScript 5.9.md"
+ | "release-notes/TypeScript 6.0.md"
| "tutorials/ASP.NET Core.md"
| "tutorials/Angular.md"
| "tutorials/Babel with TypeScript.md"
diff --git a/packages/glossary/package.json b/packages/glossary/package.json
index 665e12bb0..c3ce1aeec 100644
--- a/packages/glossary/package.json
+++ b/packages/glossary/package.json
@@ -14,6 +14,6 @@
"semi": true
},
"devDependencies": {
- "ts-node": "*"
+ "ts-node": "^10.9.2"
}
}
diff --git a/packages/glossary/tsconfig.json b/packages/glossary/tsconfig.json
index e2cd60109..60b27f4cf 100644
--- a/packages/glossary/tsconfig.json
+++ b/packages/glossary/tsconfig.json
@@ -2,6 +2,7 @@
"compilerOptions": {
"resolveJsonModule": true,
"allowJs": true,
- "types": ["*"]
+ "noEmit": true,
+ "types": ["node"]
}
}
diff --git a/packages/playground-examples/package.json b/packages/playground-examples/package.json
index df6ea1739..4de14f3d3 100644
--- a/packages/playground-examples/package.json
+++ b/packages/playground-examples/package.json
@@ -9,7 +9,7 @@
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
- "fs-extra": "^11.2.0",
+ "fs-extra": "^11.3.3",
"json5": "^2.2.3"
}
}
diff --git a/packages/playground-worker/package.json b/packages/playground-worker/package.json
index c5bdb62ab..d91678200 100644
--- a/packages/playground-worker/package.json
+++ b/packages/playground-worker/package.json
@@ -7,7 +7,7 @@
"build": "esbuild index.ts --outdir=../typescriptlang-org/static/js/playground-worker --format=esm --target=es2020 --bundle"
},
"dependencies": {
- "esbuild": "^0.17.8"
+ "esbuild": "^0.27.3"
},
"devDependencies": {
"typescript": "*"
diff --git a/packages/playground/package.json b/packages/playground/package.json
index e3a862f30..1387e40e5 100644
--- a/packages/playground/package.json
+++ b/packages/playground/package.json
@@ -17,14 +17,14 @@
"dependencies": {
"@typescript/playground-worker": "workspace:*",
"@typescript/sandbox": "workspace:*",
- "esbuild": "^0.17.8"
+ "esbuild": "^0.27.3"
},
"devDependencies": {
- "@types/jest": "^29.5.12",
- "@types/react": "^18.3.2",
- "jest": "^29.5.0",
+ "@types/jest": "^30.0.0",
+ "@types/react": "^18.3.28",
+ "jest": "^30.2.0",
"monaco-editor": "^0.32.1",
- "monaco-typescript": "^3.7.0",
+ "monaco-typescript": "^4.10.0",
"typescript": "*"
}
}
diff --git a/packages/playground/src/createConfigDropdown.ts b/packages/playground/src/createConfigDropdown.ts
index 11be14f64..2d1c67f7a 100644
--- a/packages/playground/src/createConfigDropdown.ts
+++ b/packages/playground/src/createConfigDropdown.ts
@@ -50,6 +50,40 @@ const notRelevantToPlayground = [
"forceConsistentCasingInFileNames",
]
+const createInfoIcon = () => {
+ const svgNamespace = "http://www.w3.org/2000/svg"
+ const svg = document.createElementNS(svgNamespace, "svg")
+ svg.setAttribute("width", "20px")
+ svg.setAttribute("height", "20px")
+ svg.setAttribute("viewBox", "0 0 20 20")
+ svg.setAttribute("version", "1.1")
+
+ const g = document.createElementNS(svgNamespace, "g")
+ g.setAttribute("stroke", "none")
+ g.setAttribute("stroke-width", "1")
+ g.setAttribute("fill", "none")
+ g.setAttribute("fill-rule", "evenodd")
+ svg.appendChild(g)
+
+ const circle = document.createElementNS(svgNamespace, "circle")
+ circle.setAttribute("stroke", "#0B6F57")
+ circle.setAttribute("cx", "10")
+ circle.setAttribute("cy", "10")
+ circle.setAttribute("r", "9")
+ g.appendChild(circle)
+
+ const path = document.createElementNS(svgNamespace, "path")
+ path.setAttribute(
+ "d",
+ "M9.99598394,6 C10.2048193,6 10.4243641,5.91700134 10.6546185,5.75100402 C10.8848728,5.58500669 11,5.33601071 11,5.00401606 C11,4.66666667 10.8848728,4.41499331 10.6546185,4.24899598 C10.4243641,4.08299866 10.2048193,4 9.99598394,4 C9.79250335,4 9.57563588,4.08299866 9.34538153,4.24899598 C9.11512718,4.41499331 9,4.66666667 9,5.00401606 C9,5.33601071 9.11512718,5.58500669 9.34538153,5.75100402 C9.57563588,5.91700134 9.79250335,6 9.99598394,6 Z M10.6877323,16 L10.6877323,14.8898836 L10.6877323,8 L9.30483271,8 L9.30483271,9.11011638 L9.30483271,16 L10.6877323,16 Z"
+ )
+ path.setAttribute("fill", "#0B6F57")
+ path.setAttribute("fill-rule", "nonzero")
+ g.appendChild(path)
+
+ return svg
+}
+
export const createConfigDropdown = (sandbox: Sandbox, monaco: Monaco) => {
const configContainer = document.getElementById("config-container")!
const container = document.createElement("div")
@@ -106,7 +140,11 @@ export const createConfigDropdown = (sandbox: Sandbox, monaco: Monaco) => {
.forEach(categoryID => {
const categoryDiv = document.createElement("div")
const header = document.createElement("h4")
+ const headerId = "category-header-" + categoryID
+ header.id = headerId
const ol = document.createElement("ol")
+ ol.setAttribute("role", "group")
+ ol.setAttribute("aria-labelledby", headerId)
Object.keys(categoryMap[categoryID]).forEach(optID => {
const optSummary = categoryMap[categoryID][optID]
@@ -117,13 +155,21 @@ export const createConfigDropdown = (sandbox: Sandbox, monaco: Monaco) => {
label.style.position = "relative"
label.style.width = "100%"
- const svg = ``
- label.innerHTML = `${optSummary.id}${svg} ${optSummary.oneliner}`
+ const optionName = document.createElement("span")
+ optionName.textContent = optSummary.id
+ label.appendChild(optionName)
+
+ const optionReference = document.createElement("a")
+ optionReference.href = `../tsconfig#${optSummary.id}`
+ optionReference.className = "compiler_info_link"
+ optionReference.setAttribute("aria-label", `Look up ${optSummary.id} in the TSConfig Reference`)
+ optionReference.target = "_blank"
+ optionReference.rel = "noopener noreferrer"
+ optionReference.appendChild(createInfoIcon())
+ label.appendChild(optionReference)
+
+ label.appendChild(document.createElement("br"))
+ label.appendChild(document.createTextNode(optSummary.oneliner))
const input = document.createElement("input")
input.value = optSummary.id
@@ -240,7 +286,7 @@ const createSelect = (title: string, id: string, blurb: string, sandbox: Sandbox
})
const span = document.createElement("span")
- span.innerHTML = blurb
+ span.textContent = blurb
span.classList.add("compiler-flag-blurb")
label.appendChild(span)
diff --git a/packages/playground/src/createElements.ts b/packages/playground/src/createElements.ts
index 5cee7a81b..3569a9733 100644
--- a/packages/playground/src/createElements.ts
+++ b/packages/playground/src/createElements.ts
@@ -119,8 +119,8 @@ export const createSidebar = () => {
return sidebar
}
-const toggleIconWhenOpen = "⇥"
-const toggleIconWhenClosed = "⇤"
+const toggleIconWhenOpen = "\u21E5"
+const toggleIconWhenClosed = "\u21E4"
export const setupSidebarToggle = () => {
const toggle = document.getElementById("sidebar-toggle")!
@@ -129,7 +129,7 @@ export const setupSidebarToggle = () => {
const sidebar = window.document.querySelector(".playground-sidebar") as HTMLDivElement
const sidebarShowing = sidebar.style.display !== "none"
- toggle.innerHTML = sidebarShowing ? toggleIconWhenOpen : toggleIconWhenClosed
+ toggle.textContent = sidebarShowing ? toggleIconWhenOpen : toggleIconWhenClosed
toggle.setAttribute("aria-label", sidebarShowing ? "Hide Sidebar" : "Show Sidebar")
}
diff --git a/packages/playground/src/ds/createDesignSystem.ts b/packages/playground/src/ds/createDesignSystem.ts
index a4089e42b..f83380725 100644
--- a/packages/playground/src/ds/createDesignSystem.ts
+++ b/packages/playground/src/ds/createDesignSystem.ts
@@ -1,5 +1,5 @@
import type { Sandbox } from "@typescript/sandbox"
-import type { DiagnosticRelatedInformation, Node } from "typescript"
+import type { DiagnosticRelatedInformation, Node as TSNode } from "typescript"
export type LocalStorageOption = {
blurb: string
@@ -17,9 +17,24 @@ export type OptionsListConfig = {
requireRestart?: true
}
+type ElementChild = string | Node
+
+const appendChildren = (el: Element, children: ElementChild[]) => {
+ children.forEach(child => {
+ el.appendChild(typeof child === "string" ? document.createTextNode(child) : child)
+ })
+}
+
const el = (str: string, elementType: string, container: Element) => {
const el = document.createElement(elementType)
- el.innerHTML = str
+ el.textContent = str
+ container.appendChild(el)
+ return el
+}
+
+const elWithChildren = (children: ElementChild[], elementType: string, container: Element) => {
+ const el = document.createElement(elementType)
+ appendChildren(el, children)
container.appendChild(el)
return el
}
@@ -102,8 +117,11 @@ export const createDesignSystem = (sandbox: Sandbox) => {
const li = document.createElement("li")
const label = document.createElement("label")
- const split = setting.oneline ? "" : " "
- label.innerHTML = `${setting.display}${split}${setting.blurb}`
+ const display = document.createElement("span")
+ display.textContent = setting.display
+ label.appendChild(display)
+ if (!setting.oneline) label.appendChild(document.createElement("br"))
+ label.appendChild(document.createTextNode(setting.blurb))
const key = setting.flag
const input = document.createElement("input")
@@ -187,6 +205,32 @@ export const createDesignSystem = (sandbox: Sandbox) => {
return noErrorsMessage
}
+ const link = (href: string, text: string) => {
+ const a = document.createElement("a")
+ a.href = href
+ a.textContent = text
+ return a
+ }
+
+ const inlineCode = (text: string) => {
+ const code = document.createElement("code")
+ code.textContent = text
+ return code
+ }
+
+ const lineBreak = () => document.createElement("br")
+
+ const unorderedList = (...items: ElementChild[][]) => {
+ const ul = document.createElement("ul")
+ items.forEach(item => {
+ const li = document.createElement("li")
+ appendChildren(li, item)
+ ul.appendChild(li)
+ })
+ container.appendChild(ul)
+ return ul
+ }
+
const createTabBar = () => {
const tabBar = document.createElement("div")
tabBar.classList.add("playground-plugin-tabview")
@@ -305,13 +349,13 @@ export const createDesignSystem = (sandbox: Sandbox) => {
container.appendChild(ol)
}
- const createASTTree = (node: Node, settings?: { closedByDefault?: true }) => {
+ const createASTTree = (node: TSNode, settings?: { closedByDefault?: true }) => {
const autoOpen = !settings || !settings.closedByDefault
const div = document.createElement("div")
div.className = "ast"
- const infoForNode = (node: Node) => {
+ const infoForNode = (node: TSNode) => {
const name = ts.SyntaxKind[node.kind]
return {
@@ -337,20 +381,21 @@ export const createDesignSystem = (sandbox: Sandbox) => {
return li
}
- const renderSingleChild = (key: string, value: Node, depth: number) => {
+ const renderSingleChild = (key: string, value: TSNode, depth: number) => {
const li = document.createElement("li")
- li.innerHTML = `${key}: `
+ li.textContent = `${key}: `
renderItem(li, value, depth + 1)
return li
}
- const renderManyChildren = (key: string, nodes: Node[], depth: number) => {
+ const renderManyChildren = (key: string, nodes: TSNode[], depth: number) => {
const children = document.createElement("div")
children.classList.add("ast-children")
const li = document.createElement("li")
- li.innerHTML = `${key}: [ `
+ li.textContent = `${key}: [`
+ li.appendChild(document.createElement("br"))
children.appendChild(li)
nodes.forEach(node => {
@@ -358,12 +403,12 @@ export const createDesignSystem = (sandbox: Sandbox) => {
})
const liEnd = document.createElement("li")
- liEnd.innerHTML += "]"
+ liEnd.textContent = "]"
children.appendChild(liEnd)
return children
}
- const renderItem = (parentElement: Element, node: Node, depth: number) => {
+ const renderItem = (parentElement: Element, node: TSNode, depth: number) => {
const itemDiv = document.createElement("div")
parentElement.appendChild(itemDiv)
itemDiv.className = "ast-tree-start"
@@ -497,6 +542,18 @@ export const createDesignSystem = (sandbox: Sandbox) => {
subtitle: (subtitle: string) => el(subtitle, "h4", container),
/** Used to show a paragraph */
p: (subtitle: string) => el(subtitle, "p", container),
+ /** Used to show a paragraph with safe DOM children */
+ pWithChildren: (...children: ElementChild[]) => elWithChildren(children, "p", container),
+ /** Used to show a section heading with safe DOM children */
+ subtitleWithChildren: (...children: ElementChild[]) => elWithChildren(children, "h4", container),
+ /** Creates an unattached anchor with safe text */
+ link,
+ /** Creates an unattached inline code element with safe text */
+ inlineCode,
+ /** Creates an unattached line break */
+ lineBreak,
+ /** Appends an unordered list with safe DOM children */
+ unorderedList,
/** When you can't do something, or have nothing to show */
showEmptyScreen,
/**
diff --git a/packages/playground/src/navigation.ts b/packages/playground/src/navigation.ts
index 2c1aece35..944713a41 100644
--- a/packages/playground/src/navigation.ts
+++ b/packages/playground/src/navigation.ts
@@ -6,6 +6,45 @@ type StoryContent =
import type { Sandbox } from "@typescript/sandbox"
+const createStoryIcon = (type: "code" | "html") => {
+ const svgNamespace = "http://www.w3.org/2000/svg"
+ const svg = document.createElementNS(svgNamespace, "svg")
+ svg.setAttribute("fill", "none")
+
+ if (type === "code") {
+ svg.setAttribute("width", "7")
+ svg.setAttribute("height", "7")
+ svg.setAttribute("viewBox", "0 0 7 7")
+
+ const rect = document.createElementNS(svgNamespace, "rect")
+ rect.setAttribute("width", "7")
+ rect.setAttribute("height", "7")
+ rect.setAttribute("fill", "#187ABF")
+ svg.appendChild(rect)
+ } else {
+ svg.setAttribute("width", "9")
+ svg.setAttribute("height", "11")
+ svg.setAttribute("viewBox", "0 0 9 11")
+
+ const path = document.createElementNS(svgNamespace, "path")
+ path.setAttribute("d", "M8 5.5V3.25L6 1H4M8 5.5V10H1V1H4M8 5.5H4V1")
+ path.setAttribute("stroke", "#C4C4C4")
+ svg.appendChild(path)
+ }
+
+ return svg
+}
+
+const createLocalDevStoryMessage = () => {
+ const p = document.createElement("p")
+ p.appendChild(document.createTextNode("Because the gatsby dev server uses JS to build your pages, and not statically, the page will not load during dev. It does work in prod though - use "))
+ const code = document.createElement("code")
+ code.textContent = "pnpm build-site"
+ p.appendChild(code)
+ p.appendChild(document.createTextNode(" to test locally with a static build."))
+ return p
+}
+
/** Use the handbook TOC which is injected into the globals to create a sidebar */
export const showNavForHandbook = (sandbox: Sandbox, escapeFunction: () => void) => {
// @ts-ignore
@@ -73,16 +112,10 @@ const updateNavWithStoryContent = (title: string, storyContent: StoryContent[],
li.classList.add("selectable")
const a = document.createElement("a")
- let logo: string
- if (element.type === "code") {
- logo = ``
- } else if (element.type === "html") {
- logo = ``
- } else {
- logo = ""
+ if (element.type === "code" || element.type === "html") {
+ a.appendChild(createStoryIcon(element.type))
}
-
- a.innerHTML = `${logo}${element.title}`
+ a.appendChild(document.createTextNode(element.title))
a.href = `/play#${prefix}-${i}`
a.onclick = e => {
@@ -164,12 +197,14 @@ const setStoryViaHref = (href: string, sandbox: Sandbox) => {
}
if (document.location.host === "localhost:8000") {
- setStory("
Because the gatsby dev server uses JS to build your pages, and not statically, the page will not load during dev. It does work in prod though - use pnpm build-site to test locally with a static build.
Failed to load the content at ${href}. Reason: ${req.status} ${req.statusText}
`, sandbox)
+ const errorMessage = document.createElement("p")
+ errorMessage.textContent = `Failed to load the content at ${href}. Reason: ${req.status} ${req.statusText}`
+ setStory(errorMessage, sandbox)
}
})
}
diff --git a/packages/playground/src/pluginUtils.ts b/packages/playground/src/pluginUtils.ts
index 0a5aa06fb..22db5fcb4 100644
--- a/packages/playground/src/pluginUtils.ts
+++ b/packages/playground/src/pluginUtils.ts
@@ -15,7 +15,7 @@ export const createUtils = (sb: any, react: typeof React) => {
const el = (str: string, elementType: string, container: Element) => {
const el = document.createElement(elementType)
- el.innerHTML = str
+ el.textContent = str
container.appendChild(el)
return el
}
diff --git a/packages/playground/src/sidebar/plugins.ts b/packages/playground/src/sidebar/plugins.ts
index 755feaeee..67729ce5c 100644
--- a/packages/playground/src/sidebar/plugins.ts
+++ b/packages/playground/src/sidebar/plugins.ts
@@ -123,15 +123,33 @@ export const optionsPlugin: PluginFactory = (i, utils) => {
const label = document.createElement("label")
- // Avoid XSS by someone injecting JS via the description, which is the only free text someone can use
- var p = document.createElement("p")
- p.appendChild(document.createTextNode(plugin.description))
- const escapedDescription = p.innerHTML
-
- const top = `${plugin.name} by ${plugin.author} ${escapedDescription}`
- const repo = plugin.href.includes("github") ? `| repo` : ""
- const bottom = `npm ${repo}`
- label.innerHTML = `${top} ${bottom}`
+ const pluginName = document.createElement("span")
+ pluginName.textContent = plugin.name
+ label.appendChild(pluginName)
+
+ label.appendChild(document.createTextNode(" by "))
+
+ const author = document.createElement("a")
+ author.href = `https://www.npmjs.com/~${plugin.author}`
+ author.textContent = plugin.author
+ label.appendChild(author)
+
+ label.appendChild(document.createElement("br"))
+ label.appendChild(document.createTextNode(plugin.description))
+ label.appendChild(document.createElement("br"))
+
+ const npm = document.createElement("a")
+ npm.href = `https://www.npmjs.com/package/${plugin.id}`
+ npm.textContent = "npm"
+ label.appendChild(npm)
+
+ if (plugin.href.includes("github")) {
+ label.appendChild(document.createTextNode(" | "))
+ const repo = document.createElement("a")
+ repo.href = plugin.href
+ repo.textContent = "repo"
+ label.appendChild(repo)
+ }
const key = "plugin-" + plugin.id
const input = document.createElement("input")
diff --git a/packages/playground/src/sidebar/runtime.ts b/packages/playground/src/sidebar/runtime.ts
index f93a003dd..a26c9cd54 100644
--- a/packages/playground/src/sidebar/runtime.ts
+++ b/packages/playground/src/sidebar/runtime.ts
@@ -2,14 +2,40 @@ import { PlaygroundPlugin, PluginFactory } from ".."
import { createUI } from "../createUI"
import { localize } from "../localizeWithFallback"
-let allLogs: string[] = []
+type LogEntry = {
+ id: string
+ name: string
+ text: string
+}
+
+let allLogs: LogEntry[] = []
let addedClearAction = false
-const cancelButtonSVG = `
-
-`
+
+const createCancelButtonSVG = () => {
+ const svgNamespace = "http://www.w3.org/2000/svg"
+ const svg = document.createElementNS(svgNamespace, "svg")
+ svg.setAttribute("width", "13")
+ svg.setAttribute("height", "13")
+ svg.setAttribute("viewBox", "0 0 13 13")
+ svg.setAttribute("fill", "none")
+
+ const circle = document.createElementNS(svgNamespace, "circle")
+ circle.setAttribute("cx", "6")
+ circle.setAttribute("cy", "7")
+ circle.setAttribute("r", "5")
+ circle.setAttribute("stroke-width", "2")
+ svg.appendChild(circle)
+
+ const line = document.createElementNS(svgNamespace, "line")
+ line.setAttribute("x1", "0.707107")
+ line.setAttribute("y1", "1.29289")
+ line.setAttribute("x2", "11.7071")
+ line.setAttribute("y2", "12.2929")
+ line.setAttribute("stroke-width", "2")
+ svg.appendChild(line)
+
+ return svg
+}
export const runPlugin: PluginFactory = (i, utils) => {
const plugin: PlaygroundPlugin = {
@@ -43,7 +69,7 @@ export const runPlugin: PluginFactory = (i, utils) => {
const logs = document.createElement("div")
logs.id = "log"
- logs.innerHTML = allLogs.join("")
+ renderLogs(logs, allLogs)
errorUL.appendChild(logs)
const logToolsContainer = document.createElement("div")
@@ -52,7 +78,7 @@ export const runPlugin: PluginFactory = (i, utils) => {
const clearLogsButton = document.createElement("div")
clearLogsButton.id = "clear-logs-button"
- clearLogsButton.innerHTML = cancelButtonSVG
+ clearLogsButton.appendChild(createCancelButtonSVG())
clearLogsButton.onclick = e => {
e.preventDefault()
clearLogsAction.run()
@@ -69,12 +95,10 @@ export const runPlugin: PluginFactory = (i, utils) => {
const inputText = e.target.value
const eleLog = document.getElementById("log")!
- eleLog.innerHTML = allLogs
- .filter(log => {
- const userLoggedText = log.substring(log.indexOf(":") + 1, log.indexOf(" "))
- return userLoggedText.includes(inputText)
- })
- .join("")
+ renderLogs(
+ eleLog,
+ allLogs.filter(log => log.text.includes(inputText))
+ )
if (inputText === "") {
const logContainer = document.getElementById("log-container")!
@@ -168,10 +192,9 @@ function rewireLoggingToElement(
obj[name] = function (...objs: any[]) {
const output = produceOutput(objs)
const eleLog = eleLocator()
- const prefix = `[${id}]: `
const eleContainerLog = eleOverflowLocator()
- allLogs.push(`${prefix}${output} `)
- eleLog.innerHTML = allLogs.join("")
+ allLogs.push({ id, name, text: output })
+ renderLogs(eleLog, allLogs)
if (autoScroll && eleContainerLog) {
eleContainerLog.scrollTop = eleContainerLog.scrollHeight
}
@@ -179,44 +202,35 @@ function rewireLoggingToElement(
}
}
- // Inline constants which are switched out at the end of processing
- const replacers = {
- "null": "1231232131231231423434534534",
- "undefined": "4534534534563567567567",
- ", ": "785y8345873485763874568734y535438",
- }
-
const objectToText = (arg: any): string => {
const isObj = typeof arg === "object"
let textRep = ""
if (arg && arg.stack && arg.message) {
- // special case for err
- textRep = htmlEscape(arg.message)
+ textRep = arg.message
} else if (arg === null) {
- textRep = replacers["null"]
+ textRep = "null"
} else if (arg === undefined) {
- textRep = replacers["undefined"]
+ textRep = "undefined"
} else if (typeof arg === "symbol") {
- textRep = `${htmlEscape(String(arg))}`
+ textRep = String(arg)
} else if (Array.isArray(arg)) {
- textRep = "[" + arg.map(objectToText).join(replacers[", "]) + "]"
+ textRep = "[" + arg.map(objectToText).join(", ") + "]"
} else if (arg instanceof Set) {
const setIter = [...arg]
- textRep = `Set (${arg.size}) {` + setIter.map(objectToText).join(replacers[", "]) + "}"
+ textRep = `Set (${arg.size}) {` + setIter.map(objectToText).join(", ") + "}"
} else if (arg instanceof Map) {
const mapIter = [...arg.entries()]
textRep =
`Map (${arg.size}) {` +
mapIter
.map(([k, v]) => `${objectToText(k)} => ${objectToText(v)}`)
- .join(replacers[", "]) +
+ .join(", ") +
"}"
} else if (typeof arg === "string") {
- textRep = '"' + htmlEscape(arg) + '"'
+ textRep = '"' + arg + '"'
} else if (isObj) {
const name = arg.constructor && arg.constructor.name || ""
- // No one needs to know an obj is an obj
- const nameWithoutObject = name && name === "Object" ? "" : htmlEscape(name)
+ const nameWithoutObject = name && name === "Object" ? "" : name
const prefix = nameWithoutObject ? `${nameWithoutObject}: ` : ""
textRep =
@@ -231,27 +245,19 @@ function rewireLoggingToElement(
},
2
).replace(/"__undefined__"/g, "undefined")
-
- textRep = htmlEscape(textRep)
} else {
- textRep = htmlEscape(String(arg))
+ textRep = String(arg)
}
return textRep
}
function produceOutput(args: any[]) {
- let result: string = args.reduce((output: any, arg: any, index) => {
+ return args.reduce((output: any, arg: any, index) => {
const textRep = objectToText(arg)
const showComma = index !== args.length - 1
- const comma = showComma ? ", " : ""
+ const comma = showComma ? ", " : ""
return output + textRep + comma + " "
}, "")
-
- Object.keys(replacers).forEach(k => {
- result = result.replace(new RegExp((replacers as any)[k], "g"), k)
- })
-
- return result
}
}
@@ -260,6 +266,20 @@ function sanitizeJS(code: string) {
return code.replace(`import "reflect-metadata"`, "").replace(`require("reflect-metadata")`, "")
}
-function htmlEscape(str: string) {
- return str.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """)
+function renderLogs(container: Element, logs: LogEntry[]) {
+ container.textContent = ""
+
+ logs.forEach((log, index) => {
+ if (index > 0) container.appendChild(document.createElement("hr"))
+
+ container.appendChild(document.createTextNode("["))
+
+ const id = document.createElement("span")
+ id.className = "log-" + log.name
+ id.textContent = log.id
+ container.appendChild(id)
+
+ container.appendChild(document.createTextNode("]: " + log.text))
+ container.appendChild(document.createElement("br"))
+ })
}
diff --git a/packages/sandbox/CHANGELOG.md b/packages/sandbox/CHANGELOG.md
index 1060f3e49..06ca2a55b 100644
--- a/packages/sandbox/CHANGELOG.md
+++ b/packages/sandbox/CHANGELOG.md
@@ -1,5 +1,24 @@
# @typescript/sandbox
+## 0.1.14
+
+### Patch Changes
+
+- [#3523](https://github.com/microsoft/TypeScript-Website/pull/3523) [`9953d5b`](https://github.com/microsoft/TypeScript-Website/commit/9953d5bf9168335e3ddad7b1752b3213f3f9a636) Thanks [@Josh-Cena](https://github.com/Josh-Cena)! - getInitialCode should not use URL hash without full prefix
+
+## 0.1.13
+
+### Patch Changes
+
+- [#3505](https://github.com/microsoft/TypeScript-Website/pull/3505) [`2072484`](https://github.com/microsoft/TypeScript-Website/commit/20724842b6eaf09f5c5d0ee40272c5569fe5c37d) Thanks [@DanielRosenwasser](https://github.com/DanielRosenwasser)! - Fix Ctrl+arrow keys in Firefox.
+
+## 0.1.12
+
+### Patch Changes
+
+- Updated dependencies [[`0daa298`](https://github.com/microsoft/TypeScript-Website/commit/0daa298f2f4526f8c66baff00b8df0290e37a4d4)]:
+ - @typescript/vfs@1.6.4
+
## 0.1.11
### Patch Changes
diff --git a/packages/sandbox/package.json b/packages/sandbox/package.json
index ee79a2a5e..1a0d64130 100644
--- a/packages/sandbox/package.json
+++ b/packages/sandbox/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript/sandbox",
- "version": "0.1.11",
+ "version": "0.1.14",
"license": "MIT",
"author": "TypeScript team",
"homepage": "https://github.com/microsoft/TypeScript-Website",
@@ -48,13 +48,13 @@
"lz-string": "^1.5.0"
},
"devDependencies": {
- "@rollup/plugin-commonjs": "^25.0.7",
- "@types/jest": "^29.5.12",
+ "@rollup/plugin-commonjs": "^29.0.0",
+ "@types/jest": "^30.0.0",
"dts-cli": "^2.0.5",
- "jest": "^29.5.0",
+ "jest": "^30.2.0",
"monaco-editor": "^0.32.1",
- "monaco-typescript": "^3.7.0",
- "ts-jest": "^29.0.5",
+ "monaco-typescript": "^4.10.0",
+ "ts-jest": "^29.4.6",
"typescript": "*"
}
}
diff --git a/packages/sandbox/src/getInitialCode.ts b/packages/sandbox/src/getInitialCode.ts
index 3e712c091..9190fdea2 100644
--- a/packages/sandbox/src/getInitialCode.ts
+++ b/packages/sandbox/src/getInitialCode.ts
@@ -7,13 +7,13 @@ import lzstring from "./vendor/lzstring.min"
*/
export const getInitialCode = (fallback: string, location: Location) => {
// Old school support
- if (location.hash.startsWith("#src")) {
+ if (location.hash.startsWith("#src=")) {
const code = location.hash.replace("#src=", "").trim()
return decodeURIComponent(code)
}
// New school support
- if (location.hash.startsWith("#code")) {
+ if (location.hash.startsWith("#code/")) {
const code = location.hash.replace("#code/", "").trim()
let userCode = lzstring.decompressFromEncodedURIComponent(code)
// Fallback incase there is an extra level of decoding:
diff --git a/packages/sandbox/src/index.ts b/packages/sandbox/src/index.ts
index b60c9ad51..0ac59d19c 100644
--- a/packages/sandbox/src/index.ts
+++ b/packages/sandbox/src/index.ts
@@ -77,7 +77,7 @@ const sharedEditorOptions: import("monaco-editor").editor.IEditorOptions = {
},
acceptSuggestionOnCommitCharacter: !isAndroid,
acceptSuggestionOnEnter: !isAndroid ? "on" : "off",
- accessibilitySupport: !isAndroid ? "on" : "off",
+ accessibilitySupport: !isAndroid ? "auto" : "off",
inlayHints: {
enabled: true,
},
diff --git a/packages/ts-twoslasher/CHANGELOG.md b/packages/ts-twoslasher/CHANGELOG.md
index 0aaa98f2a..8da7e06c3 100644
--- a/packages/ts-twoslasher/CHANGELOG.md
+++ b/packages/ts-twoslasher/CHANGELOG.md
@@ -1,5 +1,14 @@
# @typescript/twoslash
+## 3.2.12
+
+### Patch Changes
+
+- [#3509](https://github.com/microsoft/TypeScript-Website/pull/3509) [`0daa298`](https://github.com/microsoft/TypeScript-Website/commit/0daa298f2f4526f8c66baff00b8df0290e37a4d4) Thanks [@jakebailey](https://github.com/jakebailey)! - Bump dependencies
+
+- Updated dependencies [[`0daa298`](https://github.com/microsoft/TypeScript-Website/commit/0daa298f2f4526f8c66baff00b8df0290e37a4d4)]:
+ - @typescript/vfs@1.6.4
+
## 3.2.11
### Patch Changes
diff --git a/packages/ts-twoslasher/package.json b/packages/ts-twoslasher/package.json
index c9098c5a2..6bebc395b 100755
--- a/packages/ts-twoslasher/package.json
+++ b/packages/ts-twoslasher/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript/twoslash",
- "version": "3.2.11",
+ "version": "3.2.12",
"license": "MIT",
"author": "TypeScript team",
"homepage": "https://github.com/microsoft/TypeScript-Website",
@@ -28,16 +28,14 @@
"lint": "dts lint"
},
"devDependencies": {
- "@types/jest": "^29.5.12",
- "@types/prettier": "^2.7.3",
+ "@types/jest": "^30.0.0",
"dts-cli": "^2.0.5",
- "jest": "^29.5.0",
- "jest-file-snapshot": "^0.3.8",
- "markdown-magic": "^1.0.0",
- "preact": "^10.5.13",
- "prettier": "^2.3.2",
- "ts-jest": "^29.0.5",
- "tslib": "^2.6.2",
+ "jest": "^30.2.0",
+ "jest-file-snapshot": "^0.7.0",
+ "markdown-magic": "^4.8.0",
+ "preact": "^10.28.3",
+ "ts-jest": "^29.4.6",
+ "tslib": "^2.8.1",
"typescript": "*"
},
"jest": {
@@ -53,7 +51,7 @@
},
"dependencies": {
"@typescript/vfs": "workspace:*",
- "debug": "^4.1.1",
+ "debug": "^4.4.3",
"lz-string": "^1.5.0"
},
"peerDependencies": {
diff --git a/packages/tsconfig-reference/data/_types.ts b/packages/tsconfig-reference/data/_types.ts
index 1b10e7de3..270b6b8f0 100644
--- a/packages/tsconfig-reference/data/_types.ts
+++ b/packages/tsconfig-reference/data/_types.ts
@@ -30,6 +30,7 @@ export type CompilerOptionName =
| "project"
| "showConfig"
| "listFilesOnly"
+ | "ignoreConfig"
| "target"
| "module"
| "lib"
@@ -57,6 +58,7 @@ export type CompilerOptionName =
| "strictBindCallApply"
| "strictPropertyInitialization"
| "strictBuiltinIteratorReturn"
+ | "stableTypeOrdering"
| "noImplicitThis"
| "useUnknownInCatchVariables"
| "alwaysStrict"
diff --git a/packages/tsconfig-reference/package.json b/packages/tsconfig-reference/package.json
index e16ae25ff..cc54552f6 100644
--- a/packages/tsconfig-reference/package.json
+++ b/packages/tsconfig-reference/package.json
@@ -4,14 +4,14 @@
"license": "MIT",
"private": true,
"scripts": {
- "generate:json:tsconfig": "tsc --build && node --experimental-json-modules scripts/tsconfig/generateJSON",
- "generate:json:cli": "tsc --build && node --experimental-json-modules scripts/cli/generateJSON",
- "generate:json:schema": "tsc --build && node --experimental-json-modules scripts/schema/generateJSON",
- "generate:json:msbuild": "tsc --build && node --experimental-json-modules scripts/msbuild/generateJSON",
+ "generate:json:tsconfig": "tsc --build && node scripts/tsconfig/generateJSON",
+ "generate:json:cli": "tsc --build && node scripts/cli/generateJSON",
+ "generate:json:schema": "tsc --build && node scripts/schema/generateJSON",
+ "generate:json:msbuild": "tsc --build && node scripts/msbuild/generateJSON",
"generate:json": "pnpm generate:json:tsconfig && pnpm generate:json:cli && pnpm generate:json:schema && pnpm generate:json:msbuild",
- "generate:md:tsconfig": "tsc --build && node --experimental-json-modules scripts/tsconfig/generateMarkdown",
- "generate:md:cli": "tsc --build && node --experimental-json-modules scripts/cli/generateMarkdown",
- "generate:md:msbuild": "tsc --build && node --experimental-json-modules scripts/msbuild/generateMarkdown",
+ "generate:md:tsconfig": "tsc --build && node scripts/tsconfig/generateMarkdown",
+ "generate:md:cli": "tsc --build && node scripts/cli/generateMarkdown",
+ "generate:md:msbuild": "tsc --build && node scripts/msbuild/generateMarkdown",
"generate:md": "pnpm generate:md:tsconfig && pnpm generate:md:cli && pnpm generate:md:tsconfig",
"download": "node scripts/schema/downloadSchemaBase.js",
"bootstrap": "pnpm generate:json",
@@ -25,9 +25,9 @@
},
"devDependencies": {
"@types/json-schema": "^7.0.15",
- "ts-node": "*",
+ "ts-node": "^10.9.2",
"typescript": "*",
- "typescript-for-docs": "npm:typescript@5.9.3",
+ "typescript-for-docs": "npm:typescript@6.0.2",
"xml-js": "^1.6.11"
},
"type": "module"
diff --git a/packages/tsconfig-reference/scripts/schema/generateJSON.ts b/packages/tsconfig-reference/scripts/schema/generateJSON.ts
index 70aefb454..b66ce4f2f 100644
--- a/packages/tsconfig-reference/scripts/schema/generateJSON.ts
+++ b/packages/tsconfig-reference/scripts/schema/generateJSON.ts
@@ -63,6 +63,7 @@ const okToSkip = [
"out",
"references",
"typeAcquisition",
+ "stableTypeOrdering",
];
filteredOptions.forEach((option) => {
diff --git a/packages/tsconfig-reference/scripts/schema/result/schema.json b/packages/tsconfig-reference/scripts/schema/result/schema.json
index b8b907491..b61aa9157 100644
--- a/packages/tsconfig-reference/scripts/schema/result/schema.json
+++ b/packages/tsconfig-reference/scripts/schema/result/schema.json
@@ -589,6 +589,7 @@
"es2022",
"es2023",
"es2024",
+ "es2025",
"ESNext"
]
},
@@ -780,6 +781,7 @@
"es2022",
"es2023",
"es2024",
+ "es2025",
"ESNext",
"DOM",
"DOM.Iterable",
@@ -845,29 +847,38 @@
"es2024.regexp",
"es2024.sharedmemory",
"es2024.string",
- "ESNext.Array",
- "esnext.collection",
- "ESNext.Symbol",
+ "es2025.collection",
+ "es2025.float16",
+ "es2025.intl",
+ "es2025.iterator",
+ "es2025.promise",
+ "es2025.regexp",
"ESNext.AsyncIterable",
- "ESNext.Intl",
- "esnext.disposable",
+ "ESNext.Symbol",
"ESNext.BigInt",
- "ESNext.String",
- "ESNext.Promise",
"ESNext.WeakRef",
- "esnext.decorators",
"esnext.object",
"esnext.regexp",
- "esnext.iterator",
+ "ESNext.String",
"esnext.float16",
+ "esnext.iterator",
+ "ESNext.Promise",
+ "ESNext.Array",
+ "esnext.collection",
+ "esnext.date",
+ "esnext.decorators",
+ "esnext.disposable",
"esnext.error",
+ "ESNext.Intl",
"esnext.sharedmemory",
+ "esnext.temporal",
+ "esnext.typedarrays",
"decorators",
"decorators.legacy"
]
},
{
- "pattern": "^(?:[Ee][Ss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/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts
@@ -67,12 +67,15 @@ assert.deepEqual(got, expected, `Expected to find everything in ${orderedCategor
const notCompilerOptions = ["Project_Files_0", "Watch_Options_999"];
const categoriesForCompilerOpts = orderedCategories.filter((c) => !notCompilerOptions.includes(c));
+const hiddenOptions = ["stableTypeOrdering"];
+
const compilerOptions = options.filter(
(o) =>
!typeAcquisitionCompilerOptNames.includes(o.name) &&
!watchOptionCompilerOptNames.includes(o.name) &&
!buildOptionCompilerOptNames.includes(o.name) &&
- !rootOptNames.includes(o.name)
+ !rootOptNames.includes(o.name) &&
+ !hiddenOptions.includes(o.name)
);
// The TSConfig Reference is a collection of sections which have options or
diff --git a/packages/typescript-vfs/CHANGELOG.md b/packages/typescript-vfs/CHANGELOG.md
index 44a0a6853..2db411d0f 100644
--- a/packages/typescript-vfs/CHANGELOG.md
+++ b/packages/typescript-vfs/CHANGELOG.md
@@ -1,5 +1,11 @@
# @typescript/vfs
+## 1.6.4
+
+### Patch Changes
+
+- [#3509](https://github.com/microsoft/TypeScript-Website/pull/3509) [`0daa298`](https://github.com/microsoft/TypeScript-Website/commit/0daa298f2f4526f8c66baff00b8df0290e37a4d4) Thanks [@jakebailey](https://github.com/jakebailey)! - Bump dependencies
+
## 1.6.3
### Patch Changes
diff --git a/packages/typescript-vfs/package.json b/packages/typescript-vfs/package.json
index fd05d40f1..59b4b769f 100755
--- a/packages/typescript-vfs/package.json
+++ b/packages/typescript-vfs/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript/vfs",
- "version": "1.6.3",
+ "version": "1.6.4",
"license": "MIT",
"author": "TypeScript team",
"homepage": "https://github.com/microsoft/TypeScript-Website",
@@ -22,7 +22,7 @@
"start": "dts watch",
"bootstrap": "pnpm build",
"build": "dts build && pnpm make-for-website && pnpm make-global",
- "make-for-website": "cpy src/index.ts ../sandbox/src/vendor --rename=typescript-vfs.ts",
+ "make-for-website": "cpy src/index.ts ../sandbox/src/vendor --flat --rename=typescript-vfs.ts",
"make-global": "node scripts/makeGlobals.js",
"test": "dts test",
"lint": "dts lint"
@@ -41,18 +41,18 @@
"typescript": false
},
"dependencies": {
- "debug": "^4.1.1"
+ "debug": "^4.4.3"
},
"devDependencies": {
- "@types/jest": "^29.5.12",
- "babel-jest": "^29.7.0",
- "cpy-cli": "^3.1.1",
+ "@types/jest": "^30.0.0",
+ "babel-jest": "^30.2.0",
+ "cpy-cli": "^7.0.0",
"dts-cli": "^2.0.5",
- "jest": "^29.5.0",
- "jest-environment-jsdom": "^29.5.0",
- "jest-watch-typeahead": "^2.2.2",
- "ts-jest": "^29.0.5",
- "tslib": "^2.6.2",
+ "jest": "^30.2.0",
+ "jest-environment-jsdom": "^30.2.0",
+ "jest-watch-typeahead": "^3.0.1",
+ "ts-jest": "^29.4.6",
+ "tslib": "^2.8.1",
"typescript": "*"
},
"peerDependencies": {
diff --git a/packages/typescript-vfs/test/index.test.ts b/packages/typescript-vfs/test/index.test.ts
index 9c2a1d8bd..0ba7ed6fd 100644
--- a/packages/typescript-vfs/test/index.test.ts
+++ b/packages/typescript-vfs/test/index.test.ts
@@ -135,7 +135,7 @@ it("creates a map from the CDN and stores it in local storage cache", async () =
libs.forEach(l => expect(map.get("/" + l)).toBeDefined())
- expect(store.setItem).toBeCalledTimes(libs.length)
+ expect(store.setItem).toHaveBeenCalledTimes(libs.length)
})
it("creates a map from the CDN and uses the existing local storage cache", async () => {
@@ -160,7 +160,7 @@ it("creates a map from the CDN and uses the existing local storage cache", async
libs.forEach(l => expect(map.get("/" + l)).toBeDefined())
// Should be one less fetch, and the first item would be from the cache instead
- expect(store.setItem).toBeCalledTimes(libs.length - 1)
+ expect(store.setItem).toHaveBeenCalledTimes(libs.length - 1)
expect(map.get("/" + libs[0])).toMatchInlineSnapshot(`"// From Cache"`)
})
diff --git a/packages/typescript6/CHANGELOG.md b/packages/typescript6/CHANGELOG.md
new file mode 100644
index 000000000..d31373579
--- /dev/null
+++ b/packages/typescript6/CHANGELOG.md
@@ -0,0 +1,13 @@
+# @typescript/typescript6
+
+## 6.0.1
+
+### Patch Changes
+
+- [#3559](https://github.com/microsoft/TypeScript-Website/pull/3559) [`b35fd22`](https://github.com/microsoft/TypeScript-Website/commit/b35fd220588988246cfbfc48a742357f477a45bb) Thanks [@jakebailey](https://github.com/jakebailey)! - Add tsserverlibrary shim
+
+## 6.0.0
+
+### Patch Changes
+
+- [#3545](https://github.com/microsoft/TypeScript-Website/pull/3545) [`ce869b7`](https://github.com/microsoft/TypeScript-Website/commit/ce869b76541c264b480870de85d24e785c58395b) Thanks [@jakebailey](https://github.com/jakebailey)! - Initial release
diff --git a/packages/typescript6/LICENSE.txt b/packages/typescript6/LICENSE.txt
new file mode 100644
index 000000000..8746124b2
--- /dev/null
+++ b/packages/typescript6/LICENSE.txt
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/packages/typescript6/README.md b/packages/typescript6/README.md
new file mode 100644
index 000000000..0f02daa78
--- /dev/null
+++ b/packages/typescript6/README.md
@@ -0,0 +1,9 @@
+# `@typescript/typescript6`
+
+This package provides a `tsc6` command that runs TypeScript 6's `tsc`.
+
+It also reexports the TypeScript 6 API, so you can import it in your code:
+
+```ts
+import ts6 from "@typescript/typescript6";
+```
diff --git a/packages/typescript6/bin/tsc6 b/packages/typescript6/bin/tsc6
new file mode 100755
index 000000000..19c62bf7a
--- /dev/null
+++ b/packages/typescript6/bin/tsc6
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('../lib/tsc.js')
diff --git a/packages/typescript6/lib/tsc.js b/packages/typescript6/lib/tsc.js
new file mode 100644
index 000000000..069e733aa
--- /dev/null
+++ b/packages/typescript6/lib/tsc.js
@@ -0,0 +1 @@
+require("typescript/lib/tsc.js");
diff --git a/packages/typescript6/lib/tsserverlibrary.d.ts b/packages/typescript6/lib/tsserverlibrary.d.ts
new file mode 100644
index 000000000..b49328f25
--- /dev/null
+++ b/packages/typescript6/lib/tsserverlibrary.d.ts
@@ -0,0 +1,2 @@
+import ts = require("typescript");
+export = ts;
diff --git a/packages/typescript6/lib/tsserverlibrary.js b/packages/typescript6/lib/tsserverlibrary.js
new file mode 100644
index 000000000..0a3352bbe
--- /dev/null
+++ b/packages/typescript6/lib/tsserverlibrary.js
@@ -0,0 +1 @@
+module.exports = require("typescript");
diff --git a/packages/typescript6/lib/typescript.d.ts b/packages/typescript6/lib/typescript.d.ts
new file mode 100644
index 000000000..b49328f25
--- /dev/null
+++ b/packages/typescript6/lib/typescript.d.ts
@@ -0,0 +1,2 @@
+import ts = require("typescript");
+export = ts;
diff --git a/packages/typescript6/lib/typescript.js b/packages/typescript6/lib/typescript.js
new file mode 100644
index 000000000..0a3352bbe
--- /dev/null
+++ b/packages/typescript6/lib/typescript.js
@@ -0,0 +1 @@
+module.exports = require("typescript");
diff --git a/packages/typescript6/package.json b/packages/typescript6/package.json
new file mode 100644
index 000000000..2029867f4
--- /dev/null
+++ b/packages/typescript6/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@typescript/typescript6",
+ "version": "6.0.1",
+ "author": "Microsoft Corp.",
+ "homepage": "https://www.typescriptlang.org/",
+ "license": "Apache-2.0",
+ "description": "TypeScript is a language for application scale JavaScript development",
+ "keywords": [
+ "TypeScript",
+ "Microsoft",
+ "compiler",
+ "language",
+ "javascript"
+ ],
+ "bugs": {
+ "url": "https://github.com/microsoft/TypeScript/issues"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/microsoft/TypeScript.git"
+ },
+ "main": "./lib/typescript.js",
+ "types": "./lib/typescript.d.ts",
+ "bin": {
+ "tsc6": "./bin/tsc6"
+ },
+ "files": [
+ "bin",
+ "lib",
+ "LICENSE.txt",
+ "README.md"
+ ],
+ "dependencies": {
+ "typescript": "^6"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/typescriptlang-org/gatsby-config.js b/packages/typescriptlang-org/gatsby-config.js
index 300c3aca2..e6b3cf3e5 100644
--- a/packages/typescriptlang-org/gatsby-config.js
+++ b/packages/typescriptlang-org/gatsby-config.js
@@ -49,9 +49,6 @@ module.exports = {
},
},
- // Support for downloading or pre-caching pages, needed for PWAs
- // "gatsby-plugin-offline",
-
// Creates TS types for queries during `gatsby dev`
{
resolve: "gatsby-plugin-typegen",
diff --git a/packages/typescriptlang-org/gatsby-node.js b/packages/typescriptlang-org/gatsby-node.js
index cc0c00616..8bdc232d6 100644
--- a/packages/typescriptlang-org/gatsby-node.js
+++ b/packages/typescriptlang-org/gatsby-node.js
@@ -19,6 +19,8 @@ config.onPostBootstrap = () => writeAllPathsToFixture();
// see: https://github.com/gatsbyjs/gatsby/issues/17661
config.onCreateWebpackConfig = ({ loaders, actions, plugins, stage }) => {
+ const isSSR = stage === `build-html` || stage === `develop-html`;
+
actions.setWebpackConfig({
module: {
rules: [
@@ -32,6 +34,10 @@ config.onCreateWebpackConfig = ({ loaders, actions, plugins, stage }) => {
pnpapi: "commonjs pnpapi",
fs: "commonjs fs",
module: "commonjs module",
+ // In SSR stages, use Node's native util module instead of the browser
+ // polyfill (util@0.12.5), which lacks TextEncoder and breaks react-dom
+ // server rendering on Node >= 19.
+ ...(isSSR ? { util: "commonjs util" } : {}),
},
resolve: {
fallback: {
diff --git a/packages/typescriptlang-org/gatsby-ssr.js b/packages/typescriptlang-org/gatsby-ssr.js
index 065df32d5..cabc24676 100644
--- a/packages/typescriptlang-org/gatsby-ssr.js
+++ b/packages/typescriptlang-org/gatsby-ssr.js
@@ -2,7 +2,7 @@
// is set up, to let react-intl do its work with RichText in
// a message: https://github.com/formatjs/react-intl/issues/1438#issuecomment-523153456
-global.DOMParser = require("xmldom").DOMParser
+global.DOMParser = require("@xmldom/xmldom").DOMParser
const React = require("react")
exports.wrapRootElement = ({ element }) => {
diff --git a/packages/typescriptlang-org/package.json b/packages/typescriptlang-org/package.json
index 358ecc8d1..5e09f4d12 100644
--- a/packages/typescriptlang-org/package.json
+++ b/packages/typescriptlang-org/package.json
@@ -18,61 +18,57 @@
"test": "pnpm tsc && jest"
},
"dependencies": {
- "@babel/core": "^7.24.5",
- "@formatjs/intl-relativetimeformat": "^4.5.15",
- "@types/react-helmet": "^5.0.15",
+ "@babel/core": "^7.29.0",
+ "@types/react-helmet": "^6.1.11",
"@typescript/playground": "workspace:*",
"@typescript/sandbox": "workspace:*",
"@typescript/twoslash": "workspace:*",
"@typescript/vfs": "workspace:*",
- "gatsby": "^5.13.5",
- "gatsby-link": "5.6.0",
- "gatsby-plugin-catch-links": "^5.6.0",
+ "gatsby": "^5.16.1",
+ "gatsby-link": "5.16.0",
+ "gatsby-plugin-catch-links": "^5.16.0",
"gatsby-plugin-client-side-redirect": "^1.1.0",
"gatsby-plugin-i18n": "^1.0.1",
- "gatsby-plugin-manifest": "^5.6.0",
- "gatsby-plugin-offline": "^6.6.0",
- "gatsby-plugin-react-helmet": "^6.6.0",
- "gatsby-plugin-sass": "^6.6.0",
- "gatsby-plugin-sharp": "^5.6.0",
- "gatsby-plugin-sitemap": "^6.6.0",
- "gatsby-react-router-scroll": "6.6.0",
- "gatsby-remark-autolink-headers": "^6.6.0",
- "gatsby-remark-copy-linked-files": "^6.6.0",
- "gatsby-remark-emojis": "^0.4.3",
- "gatsby-remark-images": "^7.6.0",
- "gatsby-remark-responsive-iframe": "^6.6.0",
- "gatsby-remark-shiki-twoslash": "^3.0.36",
- "gatsby-remark-smartypants": "^6.6.0",
- "gatsby-source-filesystem": "^5.6.0",
- "gatsby-transformer-remark": "^6.6.0",
+ "gatsby-plugin-manifest": "^5.16.0",
+ "gatsby-plugin-react-helmet": "^6.16.0",
+ "gatsby-plugin-sass": "^6.16.0",
+ "gatsby-plugin-sharp": "^5.16.0",
+ "gatsby-plugin-sitemap": "^6.16.0",
+ "gatsby-remark-autolink-headers": "^6.16.0",
+ "gatsby-remark-copy-linked-files": "^6.16.0",
+ "gatsby-remark-images": "^7.16.0",
+ "gatsby-remark-responsive-iframe": "^6.16.0",
+ "gatsby-remark-shiki-twoslash": "^3.0.38",
+ "gatsby-remark-smartypants": "^6.16.0",
+ "gatsby-source-filesystem": "^5.16.0",
+ "gatsby-transformer-remark": "^6.16.0",
"github-slugger": "^1.5.0",
- "jsdom": "^16.2.0",
+ "jsdom": "^28.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.1.0",
- "react-intl": "^3.12.1",
- "sass": "^1.26.10",
+ "react-intl": "^7.1.14",
+ "sass": "^1.97.3",
"shiki-twoslash": "^3.1.2",
- "ts-debounce": "^2.2.0",
- "ts-node": "^10.9.1",
- "twoslash-cli": "^1.3.22",
+ "ts-debounce": "^4.0.0",
+ "ts-node": "^10.9.2",
+ "twoslash-cli": "^1.3.24",
"typescript": "*",
"xml-js": "^1.6.11"
},
"devDependencies": {
"@babel/plugin-syntax-optional-chaining": "^7.8.3",
- "@types/jest": "^29.5.12",
- "@types/react": "^18.3.2",
- "@types/react-dom": "^18.3.0",
+ "@types/jest": "^30.0.0",
+ "@types/react": "^18.3.28",
+ "@types/react-dom": "^18.3.7",
+ "@xmldom/xmldom": "^0.8.11",
"gatsby-plugin-typegen": "^3.1.0",
- "gatsby-plugin-typescript": "^5.6.0",
- "jest": "^29.5.0",
+ "gatsby-plugin-typescript": "^5.16.0",
+ "jest": "^30.2.0",
"monaco-editor": "^0.32.1",
- "node-polyfill-webpack-plugin": "^3.0.0",
- "semver": "^7.6.2",
- "ts-jest": "^29.0.5",
- "xmldom": "^0.5.0"
+ "node-polyfill-webpack-plugin": "^4.1.0",
+ "semver": "^7.7.4",
+ "ts-jest": "^29.4.6"
},
"jest": {
"preset": "ts-jest",
diff --git a/packages/typescriptlang-org/src/components/handbook/Contributors.tsx b/packages/typescriptlang-org/src/components/handbook/Contributors.tsx
index 2ad829d99..c82befe3b 100644
--- a/packages/typescriptlang-org/src/components/handbook/Contributors.tsx
+++ b/packages/typescriptlang-org/src/components/handbook/Contributors.tsx
@@ -41,7 +41,7 @@ export const Contributors = (props: ContributorsProps) => {
if (!t) return;
const pageLoadIndicator = document.querySelector("#page-loaded-time");
- if (pageLoadIndicator?.innerHTML.includes("This page")) return;
+ if (pageLoadIndicator?.textContent?.includes("This page")) return;
const start = t.navigationStart;
const end = t.domInteractive;
@@ -51,8 +51,8 @@ export const Contributors = (props: ContributorsProps) => {
if (loadTime < 0) return;
if (pageLoadIndicator) {
- pageLoadIndicator.innerHTML = "This page loaded in " + loadTime +
- " seconds.";
+ pageLoadIndicator.textContent = "This page loaded in " + loadTime +
+ " seconds.";
}
}, []);
diff --git a/packages/typescriptlang-org/src/components/layout/Sidebar.scss b/packages/typescriptlang-org/src/components/layout/Sidebar.scss
index 0f1eaa478..24ac4b986 100644
--- a/packages/typescriptlang-org/src/components/layout/Sidebar.scss
+++ b/packages/typescriptlang-org/src/components/layout/Sidebar.scss
@@ -183,7 +183,7 @@ nav#sidebar {
bottom: 120px;
padding: 10px;
margin-bottom: env(safe-area-inset-bottom);
- background-color: #c4c4c4;
+ background-color: #808080;
border-radius: 6px;
z-index: $z-index-for-handbook-nav-button;
@@ -209,6 +209,7 @@ nav#sidebar {
z-index: $z-index-for-handbook-nav;
margin-left: -800px;
width: 90%;
+ visibility: hidden;
ul {
padding-bottom: 200px;
@@ -223,6 +224,7 @@ nav#sidebar {
&.show {
margin-left: 0px;
+ visibility: visible;
}
& > ul > li,
diff --git a/packages/typescriptlang-org/src/components/layout/Sidebar.tsx b/packages/typescriptlang-org/src/components/layout/Sidebar.tsx
index 3d8d830fe..59af224f8 100644
--- a/packages/typescriptlang-org/src/components/layout/Sidebar.tsx
+++ b/packages/typescriptlang-org/src/components/layout/Sidebar.tsx
@@ -44,17 +44,21 @@ const toggleNavigationSection: MouseEventHandler = (event) => {
export const SidebarToggleButton = () => {
const toggleClick = () => {
const navSidebar = document.getElementById("sidebar")
+ const toggleButton = document.getElementById("small-device-button-sidebar")
const isOpen = navSidebar?.classList.contains("show")
if (isOpen) {
navSidebar?.classList.remove("show")
+ navSidebar?.setAttribute("inert", "")
+ toggleButton?.focus()
} else {
navSidebar?.classList.add("show")
+ navSidebar?.removeAttribute("inert")
}
}
return (
-