WebIDE problem with the minification #6162
Replies: 1 comment
-
Posted at 2019-06-13 by @gfwilliams Ok, just checked this out, you can reproduce it just with:
It says:
Basically Espruino doesn't like the minification to If you really do want to keep minifying (although there really isn't any need for what you have right now) teh try changing Posted at 2019-06-13 by @fanoush This is known issue with Esprima espruino/EspruinoTools#64 The bug is from december 2018 and last comment suggests using terser in WebIDE in future. Terser is used e.g. in webpack. Posted at 2019-06-13 by @gfwilliams It's an odd one actually - I updated Esprima pretty recently and the vast majority of lambda issues disappeared - I thought it had been sorted but there are obviously some bugs left. I haven't yet shipped terser in the IDE as it until @opichals recent commits it wouldn't have worked in the standalone version -so for now you're basically left with Closure. But again, for what you're doing minification really isn't saving you much effort, and it messes up any stack traces you might get from errors. Posted at 2019-06-13 by @fanoush One example is this short code
produces
It happens also with more complex lambdas with parameters like (x,y)=> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-06-13 by migsanvi
Hi at all!
The following program has a button connected to pin D25 (MDBT42Q firmware 2v03). When the button is pressed, the "volumeUp" command is sent to the device connected by BLE. Only when button is pressed.
I have tried the program in both Puck.js and MDBT42Q.
However, when loading the code with WebIDE with the option of "Minification" Esprima (offline) an error occurs when the button is pressed for the first time. The program keeps sending the "volumeUp" command continuously.
This is the minimized code that returns
dump ()
:For now, the size of the code is not a problem but I would like to apply the best possible optimization.
Any ideas?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions