Grit is not happy with the {{}} placeholders. Why are we not just using
<ph>?
Error processing node <?xml version="1.0" encoding="UTF-8"?>
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_TEXT_2">
Using Private Windows only changes what Brave does on your device — it doesn't change anyone else's behavior. Tor hides your IP address from the sites you visit, and hides the sites you visit from your ISP or your employer. Open a Private Window with Tor from the menu, or with {{ key }}.
</message>: {{ key }}.
Traceback (most recent call last):
File "../../tools/grit/grit.py", line 29, in <module>
sys.exit(grit.grit_runner.Main(sys.argv[1:]))
File "C:\bb4\brave-browser\src\tools\grit\grit\grit_runner.py", line 314, in Main
return toolobject.Run(options, args[1:])
File "C:\bb4\brave-browser\src\tools\grit\grit\tool\build.py", line 274, in Run
self.Process()
File "C:\bb4\brave-browser\src\tools\grit\grit\tool\build.py", line 409, in Process
self.ProcessNode(self.res, output, tmpfile)
File "C:\bb4\brave-browser\src\tools\grit\grit\tool\build.py", line 333, in ProcessNode
formatted = formatter(node, output_node.GetLanguage(), output_dir=base_dir)
File "C:\bb4\brave-browser\src\tools\grit\grit\format\data_pack.py", line 90, in Format
value = node.GetDataPackValue(lang, util.BINARY)
File "C:\bb4\brave-browser\src\tools\grit\grit\node\message.py", line 288, in GetDataPackValue
message = self.ws_at_start + self.Translate(lang) + self.ws_at_end
File "C:\bb4\brave-browser\src\tools\grit\grit\node\message.py", line 270, in Translate
self.ShouldFallbackToEnglish()
File "C:\bb4\brave-browser\src\tools\grit\grit\clique.py", line 406, in MessageForLanguage
return pseudolocales.PseudoRTLMessage(self.GetMessage())
File "C:\bb4\brave-browser\src\tools\grit\grit\pseudolocales.py", line 323, in PseudoRTLMessage
tree, placeholders = BuildTreeFromMessage(message)
File "C:\bb4\brave-browser\src\tools\grit\grit\pseudolocales.py", line 271, in BuildTreeFromMessage
return BuildTree(text), placeholders
File "C:\bb4\brave-browser\src\tools\grit\grit\pseudolocales.py", line 255, in BuildTree
assert not leftovers, leftovers
AssertionError: {{ key }}.
- When Brave Today is interacted with (scrolled down to), get the current cached feed
- When NTP is opened and Today is enabled, make sure we have either loaded data from cache or fetched the first data feed (and publishers list)
- Whilst Brave Today is open, every 1 minutes, check if the backend has an updated feed, or if it knows that remote has updated feed. The backend will only check for remote update every 10 mins (whilst Brave Today is visible), via a HEAD request.
- Every 2 hours, the backend will do an actual feed refresh regardless of whether Brave Today is open or not
Also, tighten style for indicator.
Overcomes a bug where a backdrop-filter element's ancestor which has a filter must also have a background. When this bug is fixed then this element won't need the background. Before this commit, the Widget title backgrounds would not correctly have backdrop filter because their ancestor had a blur and not also a background (it came from a higher up ancestor).
Profile prefs are now used for saving publisher / source enabled or disabled. This is more future proof as this data is not ephemeral.
Also provides a method for resetting those prefs from the NTP "customize" panel. Now that this is a regular profile pref, this could also be cleared from the regular Settings page.
Sets up an event flow from clearing history to the background process which caches the feed. It's important to clear the feed cache when the history is cleared since the feed assigns higher rank to content from hosts that the user has previously visited.
Also allows Today to be turned on and off.
Stores article url in window.history.state. When the back is loaded and has that state, we scroll down to an element that is rendered and is displaying the article url which was previously visited.
TODO: do this for list-type cards. Problem with those is that we must wait for all previous images to be loaded so that the correct scroll position is not maintained as item heights increase when images are loaded.
Use staging remote URLs for Brave Today content whilst we are waiting for production environment. This is temporary and will be replaced with production URLs before Brave Today is released to the Release channel.
Address https://github.com/brave/brave-browser/issues/5180
Storybook stores several copies of container components. This
effort eliminates them in favor of reusing a real-world component.
Limitations apply such as lack of dynamic content. State changes
are triggered via Storybook Knobs hopefully making easier for non-technical
people to understand and hack around Brave features.
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.
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.
For external assets e.g. an .svg file, webpack emits the file in the fs at the path specified by target_gen_dir or target_gen_dir + extra_relative_path. webpack also outputs a relative URL to access these assets. By default this relative URL is '/' but if we do specify an extra relative path, then we need to specify a new public relative url to access those resources. In the case of extensions, this needs to be the portion of the extra_relative_path that is deeper than where the manifest.json lives. This is because chromium matches the extension resources with ones that have the same fs path prefix as the manifest.json path.
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.