-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Include base/ platform from VS Code and leverage DomScrollableElement #5076
Conversation
@Tyriar Oh wow this looks promising. But +234,923 −438 changes? Is that for real or does that still need a basic cleanup? I'll def. need some time to go through this 😨 |
@jerch I might be able to exclude some of the folders (eg. To "review" this I wouldn't go through all of
|
Removed a bunch of files in the latest, still +82k but a lot of this is code that we would be able to leverage now |
Old
Warnings for yarn package:
New
Warnings for yarn package:
|
Looked into esbuild again today as I wasn't happy with the tree shaking in webpack. Looks like it's not good enough to find some important unused parts either, so I'm thinking maybe I need to manually include files which will increase the update from upstream burden but keep the bundle size as low as possible. |
@Tyriar Thx for the cleanup, looks much more digestible now 😸 About webpack and its tree shaking - I am not very deep into this, but it somehow rings a bell. If I remember right, their dead code elimination is heavily based on ESM module boundaries & exports, which by nature wont work well with non ESM-based projects. Not sure though if they fixed that with more recent releases... |
Yeah I tried switching to ESM and it still doesn't eliminate some particularly troublesome functions like this that are definitely not used, esbuild is the same. I'll do it manually today but keep the update script so it's still relatively easy to pull in changes (run script, then delete a bunch of files and maybe functions until the diff looks good). |
Continuing on esbuild branch: #5077 |
This is a work in progress that leverages
DomScrollableElement
from VS Code instead of our very fragile and hackyViewport
. This is something I've wanted to do for a long time but wasn't sure of how to accomplish it. This gives us a bunch of wins:base/
utils are available in xterm.js (with some exceptions, eg. workers) with seemingly low maintenance overhead.Performance is mostly on par with what we had previously.
I haven't looked into the resulting bundle yet but my thinking is that this will worth it as this is not the only thing we can leverage (eg. various widgets, helpers, data structures, etc.) and we could also remove some of our own utils that are pulled from VS Code's codebase (like
Lifecycle.ts
, potentially evenInstantiationService
). Only the imported files should be included in the bundle, I'm not sure what the tree shaking situation is though. I've optimized the vs/base inclusion for easy tracking of the vscode main branch for when new useful changes come in.Here's what it looks like atm:
When the overview ruler is enabled a black border now shows up and it's pixel perfect with the scroll bar:
TODOs in
src/browser/
andsrc/common/
the code track most remaining items. Here are the high level items:base/
, should we be git excluding some parts?@jerch I'm curious on your thoughts on this change