Skip to content

Consolidate code and conditional build - #191

Merged
matatk merged 17 commits into
masterfrom
consolidate-code-and-conditional-build
Aug 4, 2018
Merged

Consolidate code and conditional build#191
matatk merged 17 commits into
masterfrom
consolidate-code-and-conditional-build

Conversation

@matatk

@matatk matatk commented Aug 4, 2018

Copy link
Copy Markdown
Owner

This massively re-organises the code around ES6 modules, to make it much simpler when built, so that:

  • Things like the injector are much simpler.
  • It’s easier to add/remove code.
  • It’s easy to do cross-browser behavioural differences and not include code/data that needn’t be.

Fixes #189

matatk added 17 commits July 30, 2018 23:14
* This just-about works on Firefox; need to do build environment
  variables next, and a lot of clean-up. It's a mess for any browser
  other than Firefox. Also the code that represents the entry points
  should be named appropriately (e.g. '_content.js'?) and all of the
  filenames need looking at. Finally, the names of exports should be
  looked at---should they be hardcoded, or default?
* Updated tests to use rollup-generated test code (much simpler; very
  neat and easy :-)).
* Had to disable linting the build/ dir afterwards (due to semicolons
  etc.); would like to re-enable that.
* This ignores and removes certain scripts. In future it would be neater
  for them to be generated and go directly to their build directories,
  rather than stop over in src/static/.
* Also ensure rollup is run before a quick or a normal build.
* Set open_at_install on the sidebar to false, so that the starting
  state is always known (need to use this approach until isOpen() is fixed
  to propogate user input blessedness for event handling).
* Set minimum required Firefox version to 62 as required (partly
  addresses #190).
* Use Firefox Developer Edition for testing (due to the requirement for
  Firefox 62).
* Also open the Browser Console by default when using web-ext.
* Update deps.
* Update build script to use the plugin.
* Test the plugin in the code. This appears to've uncovered a bug with
  terser: terser/terser#92
* Thanks for the help on terser/terser#92 :-)
* Remove loadsa script inclusions from manifests.
* Create cross-browser compatibility script and import.
* Create cross-browser specialPages script and import.
* Remove now-defo-unused code from build script.
* Increase terser compress passes to two to avoid dangling strings.
* Factor out Logger.
* Give all default exports their names back.
* Remove redundant ".js" suffixes from imports.
* Remove options-change logging (debugging info).
* Rename contrast.js to contrastChecker.js to reflect name.
* Reinstate the content script injector. This always has to be imported,
  but can return null on Firefox.
* Set terser's `conditionals` compressor option so that simple tests for
  one browser can be filtered out.
Alas the output after rollup and terser was a bit wonky. Experimenting
with two spaces for now, as whilst I doubt it will be sufficiently
readable, it might take up less space in browser inspector windows, so
may be good; will see...
* Remove interface defaultSettings from Chrome and Edge.
* Remove debugging info.
* Remvoe some but not all debugging things; trying to figure out why
  Opera is not showing the browserAction toolbar button sometimes.
@matatk
matatk merged commit 22fef45 into master Aug 4, 2018
@matatk
matatk deleted the consolidate-code-and-conditional-build branch August 4, 2018 19:11
Comment thread README.md
- 2.4.0 - in development
- Show the current keyboard commands on the splash page and allow the user to update them on Chrome and Opera. \[[\#187](https://github.com/matatk/landmarks/pull/187)\]
- Offer an optional sidebar instead of the pop-up on Firefox and Opera. \[[\#188](https://github.com/matatk/landmarks/pull/188)\]
- Massive re-organisation of the code to make it easier to manage and accommodate and take advantage of cross-browser differences. \[[\#191](https://github.com/matatk/landmarks/pull/191)\]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to have a tab, whereas the rest has spaces.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops; good catch; thanks :-). I usually remember to replace them. Should probably reformat the whole list, but as it gets longer, the task gets less desirable... :-)

@matatk matatk mentioned this pull request Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants