In Electron apps, the cost of large modules is very real.
fs-extra is very convenient, but removing it caused 50 fewer unique
files to be required(), resultin in 60ms faster startup!
Before: 557 unique requires (1330-1340ms)
After: 507 unique requires (1270-1280ms)
Pros of bubel over babel:
- No configuration (a la standard)
- Runs twice as fast, for quicker development
- Converts everything to ES5 (which is likely to be faster than ES6,
untested)
- Easy to swap Babel back in -- low commitment
Cons:
- Less battle-tested than Babel, but recommended by React core
developer so probably not too bad
- No babel plugin support, but we're not using that right now anyway.
Can switch back to babel if we need that later
BEFORE:
$ time npm run build
> webtorrent-desktop@0.16.0 build /Users/feross/code/webtorrent-desktop
> babel --quiet src --out-dir build
npm run build 3.07s user 0.27s system 115% cpu 2.902 total
AFTER:
$ time npm run build
> webtorrent-desktop@0.16.0 build /Users/feross/code/webtorrent-desktop
> buble src --output build
npm run build 1.38s user 0.16s system 114% cpu 1.343 total
See: https://github.com/feross/capture-frame
Capture video screenshot from a `<video>` tag (at the current time)
Changes from our version:
- Added tests in Chrome/Firefox browsers.
- Use built-in TypeError (which is meant for bad arguments) instead of
custom IllegalArgumentError.
New principles for our UI:
- Components should use inline styles whenever possible
- Let's shrink the size of main.css to < 100 lines over time so it just
contains typography and basic styles
- Always require just the individual component that is needed from
Material UI so that the whole library doesn't get loaded (important for
startup perf)
The only thing we have to change is to self-close tags that don't
contain anything. This wasn't even an explicit change in standard. It
was already a rule, but I think it wasn't getting enforced very well
until a bugfix.