Skip to content

Commit bb4a1ee

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

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
@@ -212,19 +212,6 @@ const onSocketMessage = {
212212

213213
reloadApp(options, status);
214214
},
215-
// TODO: remove in v5 in favor of 'static-changed'
216-
/**
217-
* @param {string} file
218-
*/
219-
"content-changed": function contentChanged(file) {
220-
log.info(
221-
`${
222-
file ? `"${file}"` : "Content"
223-
} from static directory was changed. Reloading...`
224-
);
225-
226-
self.location.reload();
227-
},
228215
/**
229216
* @param {string} file
230217
*/

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)