-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
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) + '}');
}
...
}
Reactions are currently unavailable