-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(client): add default fallback for client #2015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
affc96a
24d207c
eb69e4c
8c90abb
d15d7d9
055d8f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,20 @@ | |
/* eslint-disable | ||
camelcase | ||
*/ | ||
const Client = __webpack_dev_server_client__; | ||
|
||
// this SockJSClient is here as a default fallback, in case inline mode | ||
// is off or the client is not injected. This will be switched to | ||
// WebsocketClient when it becomes the default | ||
const SockJSClient = require('../clients/SockJSClient'); | ||
|
||
let Client; | ||
try { | ||
// if __webpack_dev_server_client__ is undefined, we should fall back | ||
// to SockJSClient | ||
Client = __webpack_dev_server_client__; | ||
} catch (e) { | ||
Client = SockJSClient; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe more simple? Like:
|
||
|
||
let retries = 0; | ||
let client = null; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ function addEntries(config, options, server) { | |
const sockPath = options.sockPath ? `&sockPath=${options.sockPath}` : ''; | ||
const sockPort = options.sockPort ? `&sockPort=${options.sockPort}` : ''; | ||
const clientEntry = `${require.resolve( | ||
'../../client/' | ||
'../../client/default/' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change, some packages can use this directly, so changing path can break these apps |
||
)}?${domain}${sockHost}${sockPath}${sockPort}`; | ||
let hotEntry; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
"test": "npm run test:coverage", | ||
"pretest": "npm run lint", | ||
"prepare": "rimraf ./ssl/*.pem && npm run build:client", | ||
"build:client:default": "babel client-src/default --out-dir client --ignore \"./client-src/default/*.config.js\"", | ||
"build:client:default": "babel client-src/default --out-dir client/default --ignore \"./client-src/default/*.config.js\"", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change, as i written above |
||
"build:client:clients": "babel client-src/clients --out-dir client/clients", | ||
"build:client:index": "webpack ./client-src/default/index.js -o client/index.bundle.js --color --config client-src/default/webpack.config.js", | ||
"build:client:live": "webpack ./client-src/live/index.js -o client/live.bundle.js --color --config client-src/live/webpack.config.js", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to L19