Avoid serving legacy JavaScript to modern browsers

Hi all,

I am focusing on performance of javascript and pagespeed.web.dev/ throw me this warning (attachment)

(Publiez, livrez et installez du code JavaScript moderne pour des applications plus rapides  |  Articles  |  web.dev)

Haxe generates String.fromCodePoint() to the compiled code. Is there any way how to fix it, please?

Thank you

There should be less polyfills with -D js-es=6 in general, but for this thing i did PR with fix

1 Like

Thank you, it works, notification from pagespeed.web.dev is gone BUT I check generated code (attachment).

And I am using haxe.Template and there isnt function like fromCodePoint() (left side of attachment) but on my generated code fromCodePoint appeared. I dont know what a part of code is it and when is called but after calling it throw error in console.
it is likely that this part of the code will never be called? :smiley:

I dont know why haxe generates function fromCodePoint instead of fromCharCode like is defined in Template.hx. I am using the newest version of Haxe 4.3.4

Thank you

Yes, String.fromCharCode in Haxe has specification like String.fromCodePoint in JS, and this is why this method is generated for js target. For example, for arr.contains() haxe will generate arr.includes() in js output. Haxe just has different methods naming.