Commit bb1a242
committed
Set TypeScript target to ES6 (ES2015 / ECMAScript 2015)
Related issue: kaitai-io/kaitai_struct#539
See also kaitai-io/kaitai_struct#542 (comment)
---
The ECMAScript 5 (ES5) target was deprecated in TypeScript 6.0, see
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html#deprecated-target-es5
ES6 (ES2015) is now the TypeScript's lowest target.
ES6 is widely supported across JavaScript engines, see
https://compat-table.github.io/compat-table/es6/
As can be seen from the table and also from https://zoo.js.org/, there
are several non-mainstream JS engines that don't support ES6 classes
(which is the main feature we need), namely:
* Rhino 1.9.0 - see mozilla/rhino#835 and
https://github.com/ivankra/javascript-zoo-data/blob/8d76f329c686f006081842b5c5091880e49efd03/compat-table/rhino.json#L400
* Hermes 0.12.0 - see facebook/hermes#685;
Hermes 0.13.0 likely already supports them, Hermes V1 (the default
`static_h` branch of the https://github.com/facebook/hermes repo; see
https://zoo.js.org/#hermes-v1) definitely does, see
https://github.com/ivankra/javascript-zoo-data/blob/8d76f329c686f006081842b5c5091880e49efd03/compat-table/hermes_full.json#L381-L404
* Nashorn 15.7 (labeled "JJS 1.8" at
https://compat-table.github.io/compat-table/es6/) - see
https://github.com/ivankra/javascript-zoo-data/blob/8d76f329c686f006081842b5c5091880e49efd03/compat-table/nashorn.json#L401
and https://bugs.openjdk.org/browse/JDK-8066046
* Duktape 2.7 - apparently abandoned, see
https://github.com/svaarala/duktape (last release in February 2022 and
no commits since January 2024)
I believe it makes sense to leave these rather outdated JavaScript
runtimes behind and no longer support them out of the box in future
versions of Kaitai Struct. If any of our users use one of the runtimes
listed above or another ES5-only runtime, they can continue using
existing versions of Kaitai Struct, or use [Babel](https://babeljs.io/)
to transpile ES6 code to ES5.1 parent 0100f8c commit bb1a242
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments