fgnass / domino

Server-side DOM implementation based on Mozilla's dom.js
BSD 2-Clause "Simplified" License
768 stars 120 forks source link

wrap/replace eval calls with function constructor calls to make the sloppy file strict-mode compliant #180

Open Haringat opened 2 years ago

Haringat commented 2 years ago

Any problem in computer science can be solved by adding another layer of indirection.

This fixes all issues related with sloppy.js not being strict-mode compliant like #170 and #153 Aside from that it also provides a better separation between the evaluated code and domino as the evaluated code can no longer accidentally fall through to variables like file, require or __dirname because the function constructor code is always evaluated at top-level (where these do not exist)

totize commented 2 years ago

Thanks so much Haringat! This fixed my Angular (13) SSR setup.

KonradNowacki commented 2 years ago

Doesnt seem to work with ng14

Haringat commented 2 years ago

@KonradNowacki would you mind posting a stack trace please? Also please bear in mind that this has not been merged yet so the latest package does not include the changes.

its-dibo commented 2 years ago

very nice, hope to be merged very soon to fix https://github.com/angular/angular/issues/45062

magyargergo commented 2 years ago

Hey @cscott @fgnass,

Could you please give more visibility to this PR? It would be nice to merge it/resolve it eventually.

Thanks!

hiepxanh commented 2 years ago

@fgnass @cscott hello, can you take a look?

Haringat commented 1 year ago

Happy Anniversary🎂