Skip to content

Commit

Permalink
add import attributes to js compat table
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed May 25, 2024
1 parent 1a1fd37 commit dcbd466
Showing 1 changed file with 33 additions and 25 deletions.
58 changes: 33 additions & 25 deletions src/content/content-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,39 @@ body:
These syntax features are conditionally transformed for older browsers depending on the configured language [target](/api/#target):
- table: |
| Syntax transform | Transformed when `--target` is below | Example |
|---------------------------------------------------------------------------------------|--------------------------------------|-----------------------------|
| [Exponentiation operator](https://github.com/tc39/proposal-exponentiation-operator) | `es2016` | `a ** b` |
| [Async functions](https://github.com/tc39/ecmascript-asyncawait) | `es2017` | `async () => {}` |
| [Asynchronous iteration](https://github.com/tc39/proposal-async-iteration) | `es2018` | `for await (let x of y) {}` |
| [Async generators](https://github.com/tc39/proposal-async-iteration) | `es2018` | `async function* foo() {}` |
| [Spread properties](https://github.com/tc39/proposal-object-rest-spread) | `es2018` | `let x = {...y}` |
| [Rest properties](https://github.com/tc39/proposal-object-rest-spread) | `es2018` | `let {...x} = y` |
| [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding) | `es2019` | `try {} catch {}` |
| [Optional chaining](https://github.com/tc39/proposal-optional-chaining) | `es2020` | `a?.b` |
| [Nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing) | `es2020` | `a ?? b` |
| [`import.meta`](https://github.com/tc39/proposal-import-meta) | `es2020` | `import.meta` |
| [Logical assignment operators](https://github.com/tc39/proposal-logical-assignment) | `es2021` | `a ??= b` |
| [Class instance fields](https://github.com/tc39/proposal-class-fields) | `es2022` | `class { x }` |
| [Static class fields](https://github.com/tc39/proposal-static-class-features) | `es2022` | `class { static x }` |
| [Private instance methods](https://github.com/tc39/proposal-private-methods) | `es2022` | `class { #x() {} }` |
| [Private instance fields](https://github.com/tc39/proposal-class-fields) | `es2022` | `class { #x }` |
| [Private static methods](https://github.com/tc39/proposal-static-class-features) | `es2022` | `class { static #x() {} }` |
| [Private static fields](https://github.com/tc39/proposal-static-class-features) | `es2022` | `class { static #x }` |
| [Ergonomic brand checks](https://github.com/tc39/proposal-private-fields-in-in) | `es2022` | `#x in y` |
| [Class static blocks](https://github.com/tc39/proposal-class-static-block) | `es2022` | `class { static {} }` |
| [Import assertions](https://github.com/tc39/proposal-import-assertions) | `esnext` | `import "x" assert {}` |
| [Auto-accessors](https://github.com/tc39/proposal-decorators#class-auto-accessors) | `esnext` | `class { accessor x }` |
| [`using` declarations](https://github.com/tc39/proposal-explicit-resource-management) | `esnext` | `using x = y` |
| [Decorators](https://github.com/tc39/proposal-decorators) | `esnext` | `@foo class Bar {}` |
| Syntax transform | Transformed when `--target` is below | Example |
|---------------------------------------------------------------------------------------|--------------------------------------|------------------------------------|
| [Exponentiation operator](https://github.com/tc39/proposal-exponentiation-operator) | `es2016` | `a ** b` |
| [Async functions](https://github.com/tc39/ecmascript-asyncawait) | `es2017` | `async () => {}` |
| [Asynchronous iteration](https://github.com/tc39/proposal-async-iteration) | `es2018` | `for await (let x of y) {}` |
| [Async generators](https://github.com/tc39/proposal-async-iteration) | `es2018` | `async function* foo() {}` |
| [Spread properties](https://github.com/tc39/proposal-object-rest-spread) | `es2018` | `let x = {...y}` |
| [Rest properties](https://github.com/tc39/proposal-object-rest-spread) | `es2018` | `let {...x} = y` |
| [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding) | `es2019` | `try {} catch {}` |
| [Optional chaining](https://github.com/tc39/proposal-optional-chaining) | `es2020` | `a?.b` |
| [Nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing) | `es2020` | `a ?? b` |
| [`import.meta`](https://github.com/tc39/proposal-import-meta) | `es2020` | `import.meta` |
| [Logical assignment operators](https://github.com/tc39/proposal-logical-assignment) | `es2021` | `a ??= b` |
| [Class instance fields](https://github.com/tc39/proposal-class-fields) | `es2022` | `class { x }` |
| [Static class fields](https://github.com/tc39/proposal-static-class-features) | `es2022` | `class { static x }` |
| [Private instance methods](https://github.com/tc39/proposal-private-methods) | `es2022` | `class { #x() {} }` |
| [Private instance fields](https://github.com/tc39/proposal-class-fields) | `es2022` | `class { #x }` |
| [Private static methods](https://github.com/tc39/proposal-static-class-features) | `es2022` | `class { static #x() {} }` |
| [Private static fields](https://github.com/tc39/proposal-static-class-features) | `es2022` | `class { static #x }` |
| [Ergonomic brand checks](https://github.com/tc39/proposal-private-fields-in-in) | `es2022` | `#x in y` |
| [Class static blocks](https://github.com/tc39/proposal-class-static-block) | `es2022` | `class { static {} }` |
| [Import assertions](https://github.com/tc39/proposal-import-assertions) | `esnext` | `import "x" assert {}`<sup>1</sup> |
| [Import attributes](https://github.com/tc39/proposal-import-attributes) | `esnext` | `import "x" with {}` |
| [Auto-accessors](https://github.com/tc39/proposal-decorators#class-auto-accessors) | `esnext` | `class { accessor x }` |
| [`using` declarations](https://github.com/tc39/proposal-explicit-resource-management) | `esnext` | `using x = y` |
| [Decorators](https://github.com/tc39/proposal-decorators) | `esnext` | `@foo class Bar {}` |
- p: >
<footer>
<sup>1</sup> Import assertions never made it into the JavaScript
specification. They are deprecated in favor of import attributes
and are actively being removed from JavaScript runtimes.
</footer>
- p: >
These syntax features are currently always passed through un-transformed:
Expand Down

0 comments on commit dcbd466

Please sign in to comment.