-
-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minified browser code in the packaged final app. #931
Conversation
- Also switched to minified `monaco` code, - Removed dead code from the packaged. Signed-off-by: Akos Kitta <[email protected]>
@@ -227,8 +227,7 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()} | |||
'Installing dependencies' | |||
); | |||
exec( | |||
`yarn --network-timeout 1000000 --cwd ${path('..', 'build')} build${isElectronPublish ? ':publish' : '' | |||
}`, | |||
`yarn --network-timeout 1000000 --cwd ${path('..', 'build')} build`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @kittaakos. Just one thing: wouldn't it be better if we'd set isElectronPublish
to true
here?
That way we could still use yarn build
to package the app in development mode when we need it. Does that make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here?
Thanks for pointing out why it did not work 👍
package the app in development mode when we need it
Good point, but when do we need a packaged app for dev mode? I could not come up with a single use-case. I think isElectronPublish
makes the packager logic confusing.
If we still want to support a packaged dev app, we need to figure out when and how to set isElectronPublish
to true
. Any proposals?
I also collected a pros-cons list if we decide always to minify the code:
Pros:
- Precisely the same will be released, which was built and verified previously,
- Consistency: simplifies the packaging logic,
- Can help with the (manual) performance measurements.
Cons:
- Bundle time would take an additional 20 sec due to
webpack
theproduction
mode (I only guessed here and did not measure) compared to the overall ~20min package time, - We have to deal with minified stack traces on the FE (Note: source maps work, I could debug the bunded app with minified code, but please verify. Thanks)
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I thought source maps wouldn't work in production mode. In that case, I guess the pros outweigh the cons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source maps wouldn't work in production mode.
Please double check if you can also debug the TS code in the bundled app. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, everything seems to work for me. Thanks @kittaakos!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
monaco
code,Signed-off-by: Akos Kitta [email protected]
Motivation
To improve the IDE load time using the minified browser code + minified
monaco
code.Change description
Other information
So this is a tiny improvement for the IDE load time, but I noticed, the bundled electron app does not contain minified code; it should.
Before the change load times:
After change load times:
Although you cannot notice significant app startup improvements 🤦 , the size of the loaded resources shows some improved numbers: it's down from
21.2 MB
to9.4 MB
.There are multiple ways to verify it.
cd /Applications/Arduino\ IDE.app/Contents/Resources/app/lib/
on macOS). Manually investigate the/vs/editor/editor.main.js
file content. You can see the originalmonaco
code in the latest RC build. With the proposed changes, all JS/CSS files are minified.DevTools
(withcmd
+alt
+i
on macOS) > switch to theNetwork
tab, and reload the window.Reviewer checklist