-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,610 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
module.exports = | ||
/******/ (function() { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ var __webpack_modules__ = ({ | ||
|
||
/***/ 887: | ||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { | ||
|
||
var __resourceQuery = ""; | ||
/* global __resourceQuery */ | ||
|
||
|
||
|
||
var urlBase = decodeURIComponent(__resourceQuery.slice(1)); | ||
exports.keepAlive = function (options) { | ||
var data = options.data; | ||
var onError = options.onError; | ||
var active = options.active; | ||
var module = options.module; | ||
var response; | ||
var request = __nccwpck_require__(605).request( | ||
urlBase + data, | ||
{ | ||
agent: false, | ||
headers: { accept: "text/event-stream" } | ||
}, | ||
function (res) { | ||
response = res; | ||
response.on("error", errorHandler); | ||
if (!active && !module.hot) { | ||
console.log( | ||
"Hot Module Replacement is not enabled. Waiting for process restart..." | ||
); | ||
} | ||
} | ||
); | ||
function errorHandler(err) { | ||
err.message = | ||
"Problem communicating active modules to the server: " + err.message; | ||
onError(err); | ||
} | ||
request.on("error", errorHandler); | ||
request.end(); | ||
return function () { | ||
response.destroy(); | ||
}; | ||
}; | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 605: | ||
/***/ (function(module) { | ||
|
||
module.exports = require("http");; | ||
|
||
/***/ }) | ||
|
||
/******/ }); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __nccwpck_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ if(__webpack_module_cache__[moduleId]) { | ||
/******/ return __webpack_module_cache__[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ var threw = true; | ||
/******/ try { | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__); | ||
/******/ threw = false; | ||
/******/ } finally { | ||
/******/ if(threw) delete __webpack_module_cache__[moduleId]; | ||
/******/ } | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/compat */ | ||
/******/ | ||
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/ | ||
/******/ // module exports must be returned from runtime so entry inlining is disabled | ||
/******/ // startup | ||
/******/ // Load entry module and return exports | ||
/******/ return __nccwpck_require__(887); | ||
/******/ })() | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
module.exports = | ||
/******/ (function() { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ var __webpack_modules__ = ({ | ||
|
||
/***/ 949: | ||
/***/ (function(__unused_webpack_module, exports) { | ||
|
||
var __resourceQuery = ""; | ||
/* global __resourceQuery */ | ||
|
||
|
||
|
||
if (typeof EventSource !== "function") { | ||
throw new Error( | ||
"Environment doesn't support lazy compilation (requires EventSource)" | ||
); | ||
} | ||
|
||
var urlBase = decodeURIComponent(__resourceQuery.slice(1)); | ||
var activeEventSource; | ||
var activeKeys = new Map(); | ||
var errorHandlers = new Set(); | ||
|
||
var updateEventSource = function updateEventSource() { | ||
if (activeEventSource) activeEventSource.close(); | ||
if (activeKeys.size) { | ||
activeEventSource = new EventSource( | ||
urlBase + Array.from(activeKeys.keys()).join("@") | ||
); | ||
activeEventSource.onerror = function (event) { | ||
errorHandlers.forEach(function (onError) { | ||
onError( | ||
new Error( | ||
"Problem communicating active modules to the server: " + | ||
event.message + | ||
" " + | ||
event.filename + | ||
":" + | ||
event.lineno + | ||
":" + | ||
event.colno + | ||
" " + | ||
event.error | ||
) | ||
); | ||
}); | ||
}; | ||
} else { | ||
activeEventSource = undefined; | ||
} | ||
}; | ||
|
||
exports.keepAlive = function (options) { | ||
var data = options.data; | ||
var onError = options.onError; | ||
var active = options.active; | ||
var module = options.module; | ||
errorHandlers.add(onError); | ||
var value = activeKeys.get(data) || 0; | ||
activeKeys.set(data, value + 1); | ||
if (value === 0) { | ||
updateEventSource(); | ||
} | ||
if (!active && !module.hot) { | ||
console.log( | ||
"Hot Module Replacement is not enabled. Waiting for process restart..." | ||
); | ||
} | ||
|
||
return function () { | ||
errorHandlers.delete(onError); | ||
setTimeout(function () { | ||
var value = activeKeys.get(data); | ||
if (value === 1) { | ||
activeKeys.delete(data); | ||
updateEventSource(); | ||
} else { | ||
activeKeys.set(data, value - 1); | ||
} | ||
}, 1000); | ||
}; | ||
}; | ||
|
||
|
||
/***/ }) | ||
|
||
/******/ }); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __nccwpck_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ if(__webpack_module_cache__[moduleId]) { | ||
/******/ return __webpack_module_cache__[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ var threw = true; | ||
/******/ try { | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__); | ||
/******/ threw = false; | ||
/******/ } finally { | ||
/******/ if(threw) delete __webpack_module_cache__[moduleId]; | ||
/******/ } | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/compat */ | ||
/******/ | ||
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/ | ||
/******/ // module exports must be returned from runtime so entry inlining is disabled | ||
/******/ // startup | ||
/******/ // Load entry module and return exports | ||
/******/ return __nccwpck_require__(949); | ||
/******/ })() | ||
; |