Skip to content

Commit 0d01e32

Browse files
author
Shane Osbourne
committed
remove xip
1 parent bf5db7a commit 0d01e32

File tree

10 files changed

+47
-131
lines changed

10 files changed

+47
-131
lines changed

package-lock.json

+41-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lerna": "^6.1.0"
1313
},
1414
"dependencies": {
15-
"@playwright/test": "^1.37.1",
15+
"@playwright/test": "^1.43.0",
1616
"rxjs": "^7.5.4",
1717
"zod": "^3.22.2"
1818
},

packages/browser-sync-client/lib/types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export interface InitOptions {
5656
serveStatic: any[];
5757
scrollElementMapping: any[];
5858
scrollProportionally: boolean;
59-
xip: boolean;
6059
}
6160

6261
interface ISnippetOptions {

packages/browser-sync-client/lib/types/types.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ interface IBrowserSyncOptions {
6060
serveStatic: any[];
6161
scrollElementMapping: any[];
6262
scrollProportionally: boolean;
63-
xip: boolean;
6463
}
6564
interface ISnippetOptions {
6665
async: boolean;

packages/browser-sync-ui/test/opts.server.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
},
2828
"open": false,
2929
"browser": "default",
30-
"xip": false,
3130
"hostnameSuffix": false,
3231
"notify": true,
3332
"scrollProportionally": true,
@@ -95,4 +94,4 @@
9594
"path": "/browser-sync/browser-sync-client.js",
9695
"versioned": "/browser-sync/browser-sync-client.1.8.1.js"
9796
}
98-
}
97+
}

packages/browser-sync/cli-options/opts.start.json

-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@
7575
"type": "boolean",
7676
"desc": "Show a directory listing for the server"
7777
},
78-
"xip": {
79-
"type": "boolean",
80-
"desc": "Use xip.io domain routing"
81-
},
8278
"tunnel": {
8379
"desc": "Use a public URL"
8480
},

packages/browser-sync/lib/default-config.js

-17
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,6 @@ module.exports = {
303303
* @default null
304304
*/
305305

306-
/**
307-
* Some features of Browsersync (such as `xip` & `tunnel`) require an internet connection, but if you're
308-
* working offline, you can reduce start-up time by setting this option to `false`
309-
* @property online
310-
* @type Boolean
311-
* @default undefined
312-
*/
313-
314306
/**
315307
* Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set.
316308
* Can be `true`, `local`, `external`, `ui`, `ui-external`, `tunnel` or `false`
@@ -336,15 +328,6 @@ module.exports = {
336328
*/
337329
cors: false,
338330

339-
/**
340-
* Requires an internet connection - useful for services such as [Typekit](https://typekit.com/)
341-
* as it allows you to configure domains such as `*.xip.io` in your kit settings
342-
* @property xip
343-
* @type Boolean
344-
* @default false
345-
*/
346-
xip: false,
347-
348331
hostnameSuffix: false,
349332

350333
/**

packages/browser-sync/lib/utils.ts

+4-13
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,8 @@ export function getUrlOptions(options: BsTempOptions): Map<string, string> {
4646
}
4747

4848
const fn: typeof getHostIp = exports.getHostIp;
49-
const external = xip(fn(options, devIp()), options);
50-
let localhost = "localhost";
51-
52-
if (options.get("xip")) {
53-
localhost = "127.0.0.1";
54-
}
55-
56-
localhost = xip(localhost, options);
49+
const external = hostnameSuffix(fn(options, devIp()), options);
50+
const localhost = hostnameSuffix("localhost", options);
5751

5852
return Immutable.fromJS(getUrls(external, localhost, scheme, options));
5953
}
@@ -231,16 +225,13 @@ export function fail(kill, errMessage, cb) {
231225
}
232226

233227
/**
234-
* Add support for xip.io urls
228+
* hostnameSuffix
235229
* @param {String} host
236230
* @param {Object} options
237231
* @returns {String}
238232
*/
239-
export function xip(host, options) {
233+
export function hostnameSuffix(host, options) {
240234
var suffix = options.get("hostnameSuffix");
241-
if (options.get("xip")) {
242-
return host + ".xip.io";
243-
}
244235
if (suffix) {
245236
return host + suffix;
246237
}

packages/browser-sync/test/specs/utils/utils.setUrlOptions.js

-27
Original file line numberDiff line numberDiff line change
@@ -48,33 +48,6 @@ describe("Utils: creating URLs", function() {
4848
external: "http://" + external + ":3000"
4949
});
5050
});
51-
it("should return the external/local with xip", function() {
52-
var [opts, errors] = merge({
53-
port: 3000,
54-
server: true,
55-
https: true,
56-
online: true,
57-
xip: true
58-
});
59-
var out = utils.getUrlOptions(opts);
60-
assert.equal(out.get("local"), "https://127.0.0.1.xip.io:3000");
61-
assert.equal(
62-
out.get("external"),
63-
"https://" + external + ".xip.io:3000"
64-
);
65-
});
66-
it("should return the URLs when OFFLINE & XIP set", function() {
67-
var [opts, errors] = merge({
68-
port: 3000,
69-
server: true,
70-
scheme: "http",
71-
online: false,
72-
xip: true
73-
});
74-
assert.deepEqual(utils.getUrlOptions(opts).toJS(), {
75-
local: "http://localhost:3000"
76-
});
77-
});
7851
it("should NOT ALLOW 'listen' and 'host' options if they differ", function() {
7952
var [opts, errors] = merge({
8053
port: 3000,

packages/browser-sync/test/specs/utils/utils.xip.js

-34
This file was deleted.

0 commit comments

Comments
 (0)