You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #1987 chore(typescript): upgrade target from es2017 to es2021 (Kocal)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
chore(typescript): upgrade target from es2017 to es2021
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- For new features, provide some code snippets to help understand usage.
- Features and deprecations must be submitted against branch main.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
We are in 2024, but we still targets ES2017 which requires TypeScript to import some helper functions (to handle `const {a, ...b} = c` and private class methods), which then ship Microsoft license (cc #1937 (comment)).
Since those `dist/` files are:
- either handled by Symfony AssetMapper/ImportMap, which requires browsers to have `importmap` support (if a browser supports `importmap`, it supports rest operator and private class methods)
- either handled by Symfony Webpack Encore, which can polyfill if necessary through Babel/core-js
IMO we can configure an highest TypeScript target. We will have the following benefits:
- no more Microsoft license
- no more useless functions calls, so small performance improvments
- lighter `dist` files
WDYT?
Commits
-------
ca94369 chore(typescript): upgrade target from es2017 to es2021
@@ -2976,7 +2971,7 @@ class LiveControllerDefault extends Controller {
2976
2971
thrownewError(`No action name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-action-param" attribute?`);
2977
2972
}
2978
2973
constrawAction=params.action;
2979
-
constactionArgs=Object.assign({},params);
2974
+
constactionArgs={ ...params};
2980
2975
deleteactionArgs.action;
2981
2976
constdirectives=parseDirectives(rawAction);
2982
2977
letdebounce=false;
@@ -3003,9 +2998,8 @@ class LiveControllerDefault extends Controller {
@@ -3056,7 +3050,7 @@ class LiveControllerDefault extends Controller {
3056
3050
thrownewError(`No event name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-event-param" attribute?`);
3057
3051
}
3058
3052
consteventInfo=params.event;
3059
-
consteventArgs=Object.assign({},params);
3053
+
consteventArgs={ ...params};
3060
3054
deleteeventArgs.event;
3061
3055
constdirectives=parseDirectives(eventInfo);
3062
3056
constemits=[];
@@ -3133,7 +3127,6 @@ class LiveControllerDefault extends Controller {
0 commit comments