Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
31 KiB

4 years ago
  1. {"ast":null,"code":"\"use strict\";\n\nvar _regeneratorRuntime = require(\"@babel/runtime/regenerator\");\n\nvar _slicedToArray = require(\"@babel/runtime/helpers/slicedToArray\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports[\"default\"] = connect;\n\nvar _eventsource = require(\"./eventsource\");\n\nvar _formatWebpackMessages = _interopRequireDefault(require(\"./format-webpack-messages\"));\n\nvar ErrorOverlay = _interopRequireWildcard(require(\"next/dist/compiled/react-error-overlay\"));\n\nvar _stripAnsi = _interopRequireDefault(require(\"next/dist/compiled/strip-ansi\"));\n\nvar _sourceMapSupport = require(\"./source-map-support\");\n\nvar _unfetch = _interopRequireDefault(require(\"next/dist/build/polyfills/unfetch\"));\n/* eslint-disable camelcase */\n\n/**\nMIT License\nCopyright (c) 2013-present, Facebook, Inc.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n// This file is based on https://github.com/facebook/create-react-app/blob/v1.1.4/packages/react-dev-utils/webpackHotDevClient.js\n// It's been edited to rely on webpack-hot-middleware and to be more compatible with SSR / Next.js\n// This alternative WebpackDevServer combines the functionality of:\n// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js\n// https://github.com/webpack/webpack/blob/webpack-1/hot/dev-server.js\n// It only supports their simplest configuration (hot updates on same server).\n// It makes some opinionated choices on top, like adding a syntax error overlay\n// that looks similar to our console output. The error overlay is inspired by:\n// https://github.com/glenjamin/webpack-hot-middleware\n// This is a modified version of create-react-app's webpackHotDevClient.js\n// It implements webpack-hot-middleware's EventSource events instead of webpack-dev-server's websocket.\n// https://github.com/facebook/create-react-app/blob/25184c4e91ebabd16fe1cde3d8630830e4a36a01/packages/react-dev-utils/webpackHotDevClient.js\n\n\nvar hadRuntimeError = false;\nvar customHmrEventHandler;\n\nfunction connect(options) {\n // Open stack traces in an editor.\n ErrorOverlay.setEditorHandler(function editorHandler(_ref) {\n var fileName = _ref.fileName,\n lineNumber = _ref.lineNumber,\n colNumber = _ref.colNumber; // Resolve invalid paths coming from react-error-overlay\n\n var resolvedFilename = fileName.replace(/^webpack:\\/\\//, '');\n (0, _unfetch[\"default\"])('/_next/development/open-stack-frame-in-editor' + (\"?fileName=\" + window.encodeURIComponent(resolvedFilename)) + (\"&lineNumber=\" + (lineNumber || 1)) + (\"&colNumber=\" + (colNumber || 1)));\n }); // We need to keep track of if there has been a runtime error.\n // Essentially, we cannot guarantee application state was not corrupted by the\n // runtime error. To prevent confusing behavior, we forcibly reload the entire\n // application. This is handled below when we are notified of a compi