Commit Graph
16 Commits
Author SHA1 Message Date
Pete Miller 698addf2a3 Ensure that brave-ui and brave-core use the same styled-components modules (and same context singletons) 2021-03-11 21:31:02 +13:00
Pete Miller a97a0e1208 Webpack: offer option to prevent module concatenation
This is useful when analyzing the bundle size. Module concatenation means most modules just get combined in to 1 inside the bundle.
2020-11-07 20:58:50 -08:00
Pete Miller b3b1c38819 Webpack: generating depfile for GRD pak becomes optional 2020-11-07 20:58:49 -08:00
Pete Miller 4bb3e78cdb Allow IDEs (Visual Studio Code) to provide Tyepscript syntax highlighting for types within components/defintions/*.d.ts files 2020-11-07 20:58:49 -08:00
zenparsing 055ddace31 Revert change to webpack that eliminated Node stream module shim 2020-10-19 13:53:00 -04:00
zenparsing 7da1848cda Update webpack to bundle gifs and skip polyfill for Node streams
- Gif bundling is required for updated rewards tip dialog designs.
- Webpack was previously bundling a polyfill for Node's stream module
  due to a detected dependency in "styled-components".
- Removed unused variables.
2020-10-15 16:09:44 -04:00
Pete Miller d5bcb485ea Webpack: convert to ts-loader
ts-loader is webpack's more supported method of loading typescript files.
It's also faster for us.
Storybook compile goes from 3mins to 40s.
Storybook hot-reload compile goes from 7s to 2s
Regular NTP webpack build time stays the same (12s)
2020-01-28 22:35:58 -08:00
Pete Miller 643e564a25 Friendly class names for styled-components Elements in non-official builds
Aids devtools usage. Instead of just the classname "iHRorp", an element will get an additional className to identify the component name, e.g. "Header-sc-ofpjq6 iHRorp"
2019-12-03 10:06:51 -08:00
Feross Aboukhadijeh 0f432601e9 Remove WebTorrent DNS shim
WebTorrent now includes a built-in shim for require('dns')
in Chrome Apps. The shim is published at:
https://www.npmjs.com/package/chrome-dns

So we no longer need to include a DNS shim for WebTorrent
in Brave itself. This is the last bit of "hackiness" that
we had to remove. Now Brave is effectively shipping
WebTorrent out-of-the-box.

Fixes: https://github.com/brave/brave-browser/issues/5606
2019-08-09 17:56:23 -07:00
Feross Aboukhadijeh d1875987af Depend on upstream WebTorrent
Fixes: https://github.com/brave/brave-browser/issues/5587
Fixes: https://github.com/brave/brave-browser/issues/856
Fixes: https://github.com/brave/brave-browser/issues/5489

This makes Brave depend on upstream WebTorrent instead of the fork. This also removes the need for forks of torrent-discovery and bittorrent-tracker.
2019-08-08 22:13:56 -07:00
petemill 58fc5e5682 make transpile_web_ui build template and scripts more understandable
Adds documentation, comments, and renames and reduces variable names
2019-05-22 14:58:40 -07:00
petemill 52df79ae32 webpack build targets now generate a ninja depfile
Add a new custom plugin for webpack which keeps track of every require (or import) module path, and provide a list of these for ninja. After this, build targets which use this template will not need to provide an input list of every JS / TS / CSS / etc file that is used for the build. Instead ninja will use this new generated file to keep track of which files should cause a re-build of a specific target when they are changed.

Tested with:
- Removing inputs of a webpack target
- Generated depfile contains relevant inputs
- Target only builds when an item in the generated depfile is changed

Note that the file path used in the header of the depfile must match precisely the output of the target. If this is different then the target will always be re-built as the depfile will be invalid.
2019-05-22 14:58:33 -07:00
Cezar Augusto 8219ecee0f update css-loader in webpack config. remove .less support 2019-03-22 12:58:59 -03:00
petemill 78274a0623 Use sha ref for brave-ui dependency instead of npm-published version 2018-12-07 11:01:52 -08:00
petemill 10b86f300d webui generates es2017 output and removes confusing babel config
Babel dependencies were configured but not actually used by any webui bundles since they are all typescript.
Typescript was not configured to output using the latest features supported by v8.

This re-configuration ensures:
- TS output is transpiled to es2017 JS and no further, which should allow for optimizations. Previously it was es5.
- es module syntax is preserved, allowing webpack to tree shake
- async lazy-load import() syntax is preserved, allowing webpack to perform chunking

This also fixes an issue whereby linking brave-ui dependency from a local path would prevent webui compilation.
2018-12-05 12:50:25 -08:00
petemill dfe5df1545 Simplify webpack config
This should have no functional effect
2018-11-19 10:13:04 -08:00