- 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.
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)
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"
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
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.
ChromeComponentExtensionResourceManager::AddComponentResourceEntries now takes
GzippedGritResourceMap, so all the maps we pass in
BraveComponentExtensionResourceManager need to be gzipped.
Updated .grd files map/header directives to gzipped_resource...
Updated BasicUI to consume GzippedGritResourceMap.
Chromium change:
commit 20b9be0f2dcbece3929c1a7fa8da6b4a3d925f73
Author: Sam McNally <sammc@chromium.org>
Date: Wed Jan 30 02:29:00 2019 +0000
Add support for gzipped component app/extension resources.
Applied to the ink wasm module, this saves 3.9MB.
If applied to all Files app, Gallery etc. html/css/js resources this
could save a further 3.2MB.
Bug: 923204
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.
As a necessity for that, only build the required webpack entry-point for each target.
This creates a new GN target type "pack_web_resources", which takes the output from the transpile_web_ui target and builds in to a pack. We then take the `GritResourceMap` which is created and use it to ensure that each WebUI or Extension DataSource will serve all files that were generated.
The "transpile_web_ui" target now generates a GRD file to be consumed by this new target, which includes all the files in the webpack output dir.
We also re-pack to combine these generated assets along with their static counterparts (i.e. html file) to the single .pak file that other build targets are expecting.
Follow-ups to come afterwards which are enabled by this:
- Move most other static resources in to webpack-generated resources, especially images. This will reduce the amount of definitions that need to be kept in sync, ensure any optimizations are run, and ensure that we aren't including files that aren't used.
- Use Code Splitting to generate multiple JS files for each WebUI as appropriate.
- More consistent dir structure / targets for components/brave_xyz_ui.
fixed broken build in the branch
can update bookmarks in a sync cloud
intermediate commit 8
WIP, moving js lib to extension
move js lib to extension background page; BrowserToBackgroundPage calls
move js lib to extension background page; extension is packed
move js lib to extension background page; sync client class
move js lib to extension background page; modifying background.js
fixes after Chromium 69 rebase
fixed var keyword
reorganizing dirs
reorganizing file names
fixed classes naming
another forgotten class naming fix
don't copy resources inside src
auditors @AlexeyBarabash
fix brave_sync background page resource loading
move js lib to extension background page; strict calls schema; move brave sync api from browser to components
brave-sync and brave-crypto are built from DEPS hooks now
fixed chrome.braveSync api load
rebased patch for cr70
fixing issues after rebase to cr70
workaround for issue of binary type of json schema modified from vector<char> to vector<unsigned char> at cr69=>cr70
fixes sync-ui webpack for rebase
fixed after rebase
sync classes are per-profile now
WIP for sync history
fixes after rebase
fix after rebase
some history stuff
file work is in correct thread now; removed mutex
fix for threading during bookmarks creation
fixed threading for reset sync
fixed build after rebase
fixed missing break after rebase
initialization of bookmarks base order
can send bookmark order
storage of objects map is now typed for local id
fix for object map not existing local ids
fixed GetLocalIdByObjectId
fixes for bookmarks folders
fix for permanent folders order
switched passphrase encoding to bip39 from niceware
save order when bookmark is added
fix for add bookmark from sync situation
fixed assigning bookmark order after device just connected to chain
can delete bookmark by event from sync
wip update bookmark by event from sync
test for bookmark order utils
avoid double initialize request
object_map depends on profile path, not on whole profile
backend for ui set sync this device,bookmarks,history,settings
simple ui does set sync this device,bookmarks,history,settings
Use ConstrainedWebDialogUI instead of regular WebUI in order to gain message passing for incoming arguments and dialog-closing function.
Stub content for demonstration - to be replaced with content from brave-ui.
-
adds basic UI handler for welcome page without usable UI
while design finish the new spec for the page
-
address https://github.com/brave/brave-browser/issues/276
test plan: npm run test -- brave_browser_tests --filter=BraveWelcomeUIBrowserTest.*