_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

v0.9.7 - distributed script breaks in Safari

Open croxton opened this issue 2 years ago • 6 comments

When using the script in/dist/ directly in the browser (via https://unpkg.com/[email protected]), an error is thrown in Safari 14 and 15 breaking some (but not all) functionality.

This line throws an unexpected token error: https://github.com/bigskysoftware/_hyperscript/blob/054e04667497f204aff0a7ebfa5a1325a8adb277/dist/_hyperscript.js#L83

v0.9.5 was working previously.

croxton avatar Jul 26 '22 14:07 croxton

(Disclaimer: I'm a complete _hyperscript newbie myself!)

I just ran into the same problem. It is caused by the fact, that older Safari versions do not support static fields in classes.

As a consequence, I've forked the original code base and am now trying to "convert" the JS code into TypeScript, as that can produce JavaScript output which runs on older devices and browsers, but still offers modern JS features to the programmer.

Let us see if I succeed...

rozek avatar Jul 29 '22 13:07 rozek

Well,

I may have fixed the problem. Could you please test it as well, just by using

<script src="https://unpkg.com/hyperscript-experimental"></script>

instead of the normal script file?

rozek avatar Jul 29 '22 17:07 rozek

Reported again here https://github.com/bigskysoftware/_hyperscript/issues/369 -- sorry I missed this one. FWIW I concur with the analysis given above.

netaisllc avatar Sep 26 '22 21:09 netaisllc

it seems still an issue w v0.9.8.

IMHO iOS 14 is not that old, last update was sep 2021. Apple's stats indicates ~8% iPhone and 13% iPad users are still running <= iOS/iPad 14.

It'll be great if this can be fixed soon.

alphatownsman avatar May 25 '23 20:05 alphatownsman

Well,

I may have fixed the problem. Could you please test it as well, just by using

<script src="https://unpkg.com/hyperscript-experimental"></script>

instead of the normal script file?

Thanks for the great work here! I spot tested a few cases in my site, and it works well. Would you start a PR for your change?

alphatownsman avatar May 25 '23 20:05 alphatownsman

I will try to get this fixed this week, sorry for the issue.

1cg avatar Aug 07 '23 12:08 1cg