Commit Graph
56 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
Max Karolinskiy 14f0c07924 Revert "Component/webui resources are now gzipped."
This reverts commit 025e5ce8b8.

Chromium no longer uses gzipped resources:

commit bca1b9759444b4717c63bd2f02f10997a45530aa
Author: dpapad <dpapad@chromium.org>
Date:   Tue May 14 18:51:02 2019 +0000

    Grit: Remove gzipped_resource_* output formats.

    No longer used anywhere and not needed.

    Bug: 961063
2019-07-10 16:38:31 -04: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
Max Karolinskiy 8114d82b30 Revert "Merge pull request #2088 from brave/revert-c74-with-deps"
Reland C74 on master.

This reverts commit f6cfa13c73, reversing
changes made to 6143676339.
2019-04-01 17:46:01 -04:00
Brian Clifton 66e6c951d4 Revert Chromium 74
(originally implemented with https://github.com/brave/brave-core/pull/2013)

Fixes https://github.com/brave/brave-browser/issues/3898
2019-03-26 18:35:47 -07:00
Cezar Augusto 8219ecee0f update css-loader in webpack config. remove .less support 2019-03-22 12:58:59 -03:00
Max Karolinskiy 025e5ce8b8 Component/webui resources are now gzipped.
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
2019-03-19 16:10:00 -04: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
petemill 2fe07f9ec2 Dynamically pack and serve all webpack generated files
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.
2018-11-19 10:12:54 -08:00
AlexeyBarabash 5f72a3e6ad WIP branch. Rebasing Brave-sync to Chromium69
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
2018-11-01 18:02:39 +02:00
bridiver 3482036127 fix resource organization and dependencies
fix https://github.com/brave/brave-browser/issues/1808
2018-10-24 11:51:11 -07:00
NejcZdovc 433b074c77 Adds ui for rewards donate dialog from brave-ui
Includes tests
2018-10-11 13:25:13 -07:00
petemill 073b948b2e Add chrome://donate dialog
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.
2018-10-11 20:48:19 +02:00
Jocelyn Liu a5b2f3cae1 Fix webpack prod config for brave_rewards_panel 2018-10-02 10:08:01 -07:00
Brian Clifton 5bacae988d Merge pull request #543 from brave/welcomeicon
add welcome page favicon
2018-10-01 22:30:52 -07:00
Cezar Augusto bc2200995e add welcome page favicon
closes https://github.com/brave/brave-browser/issues/584
2018-10-01 14:07:58 -03:00
bridiver 5111c94b95 reorganize extension directory to fix grd paths
copy locale resources to bundle resources dir on mac
2018-10-01 07:33:17 -07:00
NejcZdovc 576dadd755 Adds react/redux/brave-ui to rewards panel 2018-10-01 07:33:16 -07:00
Jocelyn Liu 6f3057a61d Upgrade WebTorrent to 0.102.4 2018-09-18 10:05:22 -07:00
Jocelyn Liu 8249c55857 Shim dns.lookup using chrome.dns.resolve 2018-09-17 21:58:58 -07:00
bridiver 6581a37ac0 payments/brave_rewards_ui -> brave_rewards 2018-08-31 15:18:18 +02:00
NejcZdovc 3c1de5aa5f Adds rewards settings 2018-08-31 15:16:07 +02:00
Jocelyn Liu 4ebe7e4147 Implement webtorrent component 2018-08-30 14:20:50 -07:00
Cezar Augusto 76feb1cf1e use awesome-typescript-loader in prod config 2018-08-28 22:37:19 -03:00
NejcZdovc 495e83aa02 Updates dependecies for brave-ui to the latest version
Resolves brave/brave-browser#853
2018-08-27 19:44:56 +02:00
bridiver 96c0cedc3f let each component handle its own transpiling
fix https://github.com/brave/brave-browser/issues/702
2018-08-09 19:39:09 -07:00
Brian R. Bondy ff40756074 Revert "let each component handle its own transpiling" 2018-08-07 18:19:18 -04:00
bridiver 95d25a5fb8 let each component handle its own transpiling 2018-08-04 17:19:28 -07:00
NejcZdovc 181bddd89d Updates brave-ui to 0.20.x 2018-08-01 05:48:16 +02:00
NejcZdovc b1192dc6ec Build successful 2018-07-16 13:46:25 +02:00
NejcZdovc a489016a2b Adds tslint, travis
Adds ts-loader; Removes standard
2018-07-16 13:46:20 +02:00
NejcZdovc b4147390e0 Adds TS support 2018-07-16 13:46:07 +02:00
Brian R. Bondy 7d47f655f4 Add chrome://adblock page 2018-07-05 10:15:39 -04:00
Brian R. Bondy 504adc4fae Refactor and rename Brave Payments 2018-07-05 10:15:39 -04:00
Cezar Augusto 76c6f39f4a add about:welcome and webui handler
-
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.*
2018-07-05 10:15:38 -04:00
Cezar Augusto 40057c1bf5 remove useBabel query from awesome-typescript-loader
-
this is a leftover and not used. added unintentionally in 9e67a5b
2018-06-08 13:08:14 -03:00
Brian R. Bondy 9e67a5b670 Merge pull request #151 from brave/uglifyjs
change from built-in webpack uglify to uglifyJS webpack plugin
2018-06-08 05:01:34 -04:00
Cezar Augusto 912666ae3f change from built-in webpack uglify to uglifyJS webpack plugin
-
this was making builds impossible due to uglify not properly
transpiling ES6
2018-06-08 02:03:40 -03:00