Skip to content

Change processor to call a doiuse.com server (micro-service) #167

@groovecoder

Description

@groovecoder

This is a big architectural change and may require updates to the doiuse.com code-base itself.

When we make more doiuse interfaces - editor plugins, browser extensions, site monitors, etc., we want them to call a single doiuse.com server, so we can update all clients with the latest and greatest doiuse functionality with a single server deployment.

So, we should change discord to call to a doiuse.com server instead of using postcss(doiuse()) directly. E.g., something like:

/**
 * Runs postcss for each of the processors
 */
function _postcss(config, contents, handle, filename) {
...
          var doiuseURL = 'https://moz-doiuse.herokuapp.com';
          var doiuseXHR = new XMLHttpRequest();
          doiuseXHR.open('POST', doiuseURL);

          doiuseXHR.onreadystatechange = function () {
            if (doiuseXHR.readyState === XMLHttpRequest.DONE) {
              if (doiuseXHR.status === 200) {
                var doiuseOutput = doiuseXHR.responseText;
                alert(doiuseOutput);
              }
            }
          };

          if (styleSheetContent) {
            doiuseXHR.send('{"css":' + JSON.stringify(contents) + '}');
          }
...
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions