Closed shinout closed 4 years ago
I did some tests... https://docs.google.com/spreadsheets/d/1JIJac5lsS2d1Gm7u8Zk-cLAaGLIxh_wVlU44Iez96bU/edit?usp=sharing
It looks like the V8 runtime supports all ES2019 features.
ts2gas
already supports transpileOptions
as its second argument:
https://github.com/grant/ts2gas/blob/84d2d534769bd202b80e993b8b2309f11ff33add/src/index.ts#L9
So one could use something like:
const transpileOptions ={
compilerOptions: {
target: 'es2019',
},
}
But for it to work, the current target
should be moved from statics
to defaults
https://github.com/grant/ts2gas/blob/84d2d534769bd202b80e993b8b2309f11ff33add/src/index.ts#L176-L179
https://github.com/grant/ts2gas/blob/84d2d534769bd202b80e993b8b2309f11ff33add/src/index.ts#L157-L160
This small change should be reflected in the https://github.com/grant/ts2gas/blob/master/README.md
And add some basic test maybe.
@PopGoesTheWza Thanks:+1: Totally agree with your idea. Also thanks for your contribution.
ts2gas@3.5.1
released
Related to https://github.com/google/clasp/issues/735 https://developers.google.com/apps-script/guides/v8-runtime/migration
Now that we can use V8 runtime in GAS, it's better to generate less-transpiled files for it. There are some options for the way to support the feature.
runtimeType
as the third argument// type RuntimeType = "V8" | "Rhino"
ts2gasV8
andts2GasRhino
If you tell me which one is the best, I'm ready for PR for this.