Skip to main content

Stream report #0 from June 25th

TODOs for this stream

  1. Outline the current problems with the WebExtension
  2. Write issues for each of the problems listed (or find the existing issue)
  3. Group them into a new project
  4. Start resolving some of the found issues

What actually happened

Two major things happened:

  1. I moved the WebExtension from openwpm/Extension to Extension on the top level.

    As part of that I did the following:

    1. Moved the directory
    2. Updated build-extension.sh and update.sh
    3. Updated the xpi fixture and the deploy_firefox function
    4. Updated all grep-able references to point to the new location
  2. I fixed up ESLint and got it to run.

    For that I needed to rebase PR #930 onto the ExtensionRework branch (where I had done all of the previous work). Once that was done I started installing all the required plugins one after the other. When all required packages were installed and all rules that didn’t apply to us (e.g. React-specific rules) were removed, I started to manually go through and update the code according to the suggestions made until I realized that ESLint also offers an autofix option, which I then used.

    One rule that TSLint offered that ESLint has no appropriate replacement for is

    {
    object-literal-sort-keys: "match-declaration-order"
    }
    

    This rule enforces that when creating a literal object (something like {a:"b", c:1}) fields are always ordered the way they are ordered in the class declaration, which for OpenWPM is quite useful, since we rarely use alphabetic ordering, instead preferring the order of columns in the database schema. This is something to keep in mind for future streams, where I might file an issue to see if somebody wants to reimplement this in eslint-typescript.

Minor things that also happened

  • I removed ava, a JavaScript test framework, and a sample test (since it is impossible to test the extension on its own)

What was learned

ESLint is a static analysis tool for JavaScript that is highly pluggable. This meant I had to install a lot of packages that were required in the .eslintrc.js (which was generated for us by a migration tool) but weren’t yet part of the dev-dependencies.

It is really easy to forget updating the documentation since there is no CI (yet) to check that all links in the documentation point to actual places in the source code.

Goals should be SMART and my TODOs for this stream meet none of the criteria listed. So for the next stream I should make sure that I write my TODOs in a way that I can actually tick them off at the end.

How is OpenWPM better than it was before

With the extension at the root of the repository it is easier to find. The Extension folder no longer looks like a python package but is clearly standalone.

Getting the migration done from TSLint to ESLint allows us to cut an outdated dependency, which might have become an issue in the future.

Also slimming down the build process for the webext-instrumentation will make it easier to merge the two folders in the upcoming weeks.

Outlook for next stream

When applying the suggested fixes, I appear to have broken some tests.

In the next stream I’ll have a look at them and figure out whether the tests need adjusting (which I think is unlikely) or I broke the code during refactoring.

Once that is done I’ll have a look at the build process of the firefox part of the WebExtension and get familiar with Webpack