hebcal / hebcal-es6

perpetual Jewish Calendar with holidays, Shabbat and holiday candle lighting and havdalah times, Torah readings, and more
https://hebcal.github.io/api/core/
GNU General Public License v2.0
102 stars 15 forks source link

Google Apps Script compatibility #448

Closed PupaRebbe closed 4 months ago

PupaRebbe commented 4 months ago

Since google apps script doesn't yet support private class fields and other features used in this project from version 5>, i need to stick to version 4.5.1 for my project in GAS. I know it's google's issue, but i'm still trying to get this working with the limitations. Is there anything to do besides waiting for google?

mjradwin commented 4 months ago

Thanks for the bug report. We've had a goal to make @hebcal/core version 5.x compatible with ES6, but it looks like our recent inclusion of QuickLRU to avoid unbounded caches might be the root cause of the current incompatibility with GAS. We'll investigate how to fix that.

mjradwin commented 4 months ago

This turned out to be a super easy 10-minute fix. Try @hebcal/core 5.4.5? We pasted the new index.mjs bundle into Google Apps Script and did a simple console.log(new HDate().toString()) and it seemed to work just fine.