Closed lemoustachiste closed 1 year ago
Can you pretty-print the JS, and send me a relevant snippet of code around the for loop, please?
(I should have said pretty please. :) )
Nevermind. This is probably the while(true)
loop in Decoder._parse()
. It's fine. Decoder is a stream that may or may not ever end, by design.
Yeah it looks like code optimization. If you look at the MDN docs, for(;;)
is valid syntax (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for), provided the code has a way to break the loop.
So it's not my actual problem. I'm going to investigate a bit more and let you know.
The problem comes from a dependency of the unmaintained rollup-plugin-node-globals package which I need.
I am forking the package to update the dep, so not a problem with node-cbor as far as I can tell now
Let me know if you run into issues. I'm also getting close on a replacement library for node-cbor which has no runtime dependencies and is all ES6 -- it should be easier to drop right into your workflow.
Thanks, I'll keep an eye out
Just released v0.0.1 of cbor2 yesterday: https://github.com/hildjj/cbor2/ You should just be able to npm install, import it into your rollup project, then let rollup bundle it and tree shake it into your project.
I'm interested in opinions either way.
Hi,
so I'm trying to consume the cbor-web package instead of borc. However when I'm bundling my project with rollup, I get the following error:
When looking at what's at this index, it somewhat looks normal, but a few characters before this empty
for
loop is there, and I'm wondering if that's actually supposed to be here. (It is there in the github repo, if you search forfor(;;)
).Such syntax in a REPL creates an infinite loop so it looks weird to me.