Skip to content

Commit 50928f4

Browse files
committed
refactor!: remove the content-changed method from onSocketMessage (#4679)
1 parent b65848e commit 50928f4

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

client-src/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,6 @@ const onSocketMessage = {
256256

257257
reloadApp(options, status);
258258
},
259-
// TODO: remove in v5 in favor of 'static-changed'
260-
/**
261-
* @param {string} file
262-
*/
263-
"content-changed": function contentChanged(file) {
264-
log.info(
265-
`${
266-
file ? `"${file}"` : "Content"
267-
} from static directory was changed. Reloading...`
268-
);
269-
270-
self.location.reload();
271-
},
272259
/**
273260
* @param {string} file
274261
*/

test/client/__snapshots__/index.test.js.snap.webpack5

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ BODY: warning",
5656
]
5757
`;
5858

59-
exports[`index should run onSocketMessage['content-changed'] 1`] = `"Content from static directory was changed. Reloading..."`;
60-
61-
exports[`index should run onSocketMessage['content-changed'](file) 1`] = `"\\"/public/assets/index.html\\" from static directory was changed. Reloading..."`;
62-
6359
exports[`index should run onSocketMessage['static-changed'] 1`] = `"Content from static directory was changed. Reloading..."`;
6460

6561
exports[`index should run onSocketMessage['static-changed'](file) 1`] = `"\\"/static/assets/index.html\\" from static directory was changed. Reloading..."`;
@@ -73,7 +69,6 @@ Array [
7369
"mock-url",
7470
Object {
7571
"close": [Function],
76-
"content-changed": [Function],
7772
"error": [Function],
7873
"errors": [Function],
7974
"hash": [Function],

test/client/index.test.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,6 @@ describe("index", () => {
160160
expect(res).toEqual(undefined);
161161
});
162162

163-
test("should run onSocketMessage['content-changed']", () => {
164-
onSocketMessage["content-changed"]();
165-
166-
expect(log.log.info.mock.calls[0][0]).toMatchSnapshot();
167-
expect(self.location.reload).toBeCalled();
168-
});
169-
170-
test("should run onSocketMessage['content-changed'](file)", () => {
171-
onSocketMessage["content-changed"]("/public/assets/index.html");
172-
173-
expect(log.log.info.mock.calls[0][0]).toMatchSnapshot();
174-
expect(self.location.reload).toBeCalled();
175-
});
176-
177163
test("should run onSocketMessage['static-changed']", () => {
178164
onSocketMessage["static-changed"]();
179165

0 commit comments

Comments
 (0)