• Sean Hammond's avatar
    Use hostPageSetting() instead of Object.assign() · b8cff0a2
    Sean Hammond authored
    Use the new `settings.hostPageSetting()` method in `index.js`.
    
    This means that `index.js` no longer uses `shared/settings.js`
    (`jsonConfigsFrom()`) or `configFuncSettingsFrom()`. These are both
    encapsulated in `hostPageSetting()`.
    
    Previously `index.js` blindly assigned a lot of property names and
    values fo the `config` object using a couple of `Object.assign()` calls:
    
        Object.assign(config, sharedSettings.jsonConfigsFrom(window_.document));
        Object.assign(config, configFuncSettingsFrom(window_));
    
    These `Object.assign()`s are now gone, and instead it explicitly assigns
    each property to the `config` object by name:
    
        var config = {
          app: settings.app,
          query: settings.query,
          ...
          openLoginForm: settings.hostPageSetting('openLoginForm'),
          openSidebar: settings.hostPageSetting('openSidebar'),
          ...
        };
    
    (Some of these settings were already being assigned in this way, but the
    ones that uses `hostPageSetting()` are new.)
    
    This also means that `index.js` no longer uses `isBrowserExtension()`.
    Previously `index.js` contained logic to return early, declining to read
    various config settings from the host page using its `Object.assign()`s,
    if the client was running in a browser extension. This logic is also now
    encapsulated in the new `settings.hostPageSetting()` method and so is
    removed from `index.js`.
    b8cff0a2
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
yarn.lock Loading commit data...