neffos.js icon indicating copy to clipboard operation
neffos.js copied to clipboard

fix(neffos.js): only conditionally import node websocket dependency

Open alpjor opened this issue 5 months ago • 2 comments

alpjor avatar Jan 08 '24 21:01 alpjor

Is it tested @alpjor?

kataras avatar Jan 10 '24 19:01 kataras

@kataras I've tested this version running both in browser contexts and in a node env. I'm a little concerned about changing the target: and module: because I don't know if that'll change the support for older browsers where I haven't done any testing, but those changes where necessary to get access to the await import( syntax to conditionally load the dependency. It's a bit weird though, because before the PR you accepted of mine about the nonce, the conditional load code was there and was working, but after my PR it was gone. I think there might've been some changes in the dist folder that weren't reflected in the src folder. I looked at the compiled code in the dist folder from the commit before my change and it doesn't seem to 100% match the src code at the time (es5 and min versions were different from plain js too). Maybe a bad push? lmk what you think and thanks for looking at it. Either way, this code does work for me in my fork in all my testing in modern browser environments, I hope it helps here too

alpjor avatar Jan 10 '24 23:01 alpjor