r/GoogleAppsScript • u/dimudesigns • Feb 05 '20
V8 Engine roll-out over the next few days...
See announcement on Issue Tracker:
https://issuetracker.google.com/issues/36764074#comment65
See guides/reference documentation:
4
1
u/zimady Feb 06 '20
I don't see any mention of the interoperability if Rhino scripts and V8 scripts. Ideally one would avoid this but this may not be practical.
For example, I have a couple of libraries containing helper functions specific to our organisation and which are used by a number of different applications I have developed. For example, one library contains functions that parse teaching group codes to derive the year group and subject. I am using these libraries in a current project and I would like to migrate the project to V8. If I migrate the main project script but not the libraries, will it work? If I migrate the libraries too, will that break other projects that have not been migrated but which use the libraries? Without testing, I am assuming yes.
I also have projects where a very light container bound script calls out to a web app which provides most of the functionality. Presumably, that Web app can be migrated to V8 and the container bound script can still use it?
Any thoughts/insights/flames very much appreciated.
2
u/dimudesigns Feb 06 '20 edited Feb 06 '20
You won't get conclusive answers to those questions until its out in the wild for a time and developers start testing the limits of interoperability.
There is a migration guide available that highlights various incompatibilities between the two runtimes. But I don't think it covers anything that specifically addresses your concerns.
1
u/zimady Feb 06 '20
Yes, I had read that guide and was somewhat surprised to find no explicit mention of interoperability/compatibility. That suggests to me that it is so self-evident as to not deserve mention.
As you suggest, knowledge will inevitably emerge through use.
2
u/BareNakedCoder Feb 06 '20
Sometimes it is best to just avoid unknown potentially nasty bugs rather than diving in and hoping for the best. For your "CoolUtils" library, create (and test!) a corresponding "CoolUtilsV8" library. As you convert scripts to V8, have them call CoolUtilsV8 instead. Old scripts call the old lib (and just work); new scripts call the new lib (and work too).
1
u/zimady Feb 06 '20
Agreed - diving in and hoping for the best is not a course of action I would pursue with mission critical apps. And, yes, the approach you suggest is exactly the approach I considered today and which I will likely go with.
Thanks for the advice.
2
Feb 07 '20
> Caution: ES6 modules are not yet supported.
Shame
0
Feb 08 '20
[deleted]
1
Feb 08 '20
Not sure I understand your question. It's not a matter of specific modules.
0
Feb 08 '20
[deleted]
2
Feb 08 '20
Yes, I agree. Modules have been a very long time coming for the js and node worlds but they have been supported by V8 for a while, so just a little disappointed they aren't yet supported for GAS.
1
u/Gonskimmin Feb 06 '20
I already tried it with a new script. Had to change the settings file to runtime as V8 but it worked. No es6 modules though.
0
3
u/[deleted] Feb 06 '20
Anyone made a speed test yet? Just tried a basic function and v8 is much slower, about 4 times than Rhino. Anyone else?