Skip to content

Commit b949281

Browse files
committed
refactor: replace precompiled mqtt for mqtt browser
1 parent b912a0a commit b949281

File tree

8 files changed

+50
-435
lines changed

8 files changed

+50
-435
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
},
105105
"dependencies": {
106106
"@reduxjs/toolkit": "^1.9.3",
107+
"mqtt-browser": "^4.3.7",
107108
"mqtt-pattern": "^2.0.0",
108-
"precompiled-mqtt": "^4.3.14-beta",
109109
"react-redux": "^8.0.5",
110110
"tiny-warning": "^1.0.3"
111111
},

src/WorkflowManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
22

3-
import { MqttClient, connect } from 'precompiled-mqtt';
3+
import { MqttClient, connect } from 'mqtt-browser';
44
import invariant from 'tiny-warning';
55

66
import { MqttProvider, IMqttContext } from './contexts';

src/WorkflowManagerConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Store } from '@reduxjs/toolkit';
2+
import { MqttClient, IClientSubscribeOptions } from 'mqtt-browser';
23
import { matches, exec } from 'mqtt-pattern';
3-
import { MqttClient, IClientSubscribeOptions } from 'precompiled-mqtt';
44
import invariant from 'tiny-warning';
55

66
import { createWorkflowAction } from './ducks/utils';

src/__tests__/WorkflowManager.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { WorkflowManager } from '../WorkflowManager';
66

77
describe('WorkflowManager component', () => {
88
beforeEach(() => {
9-
const props = { brokerUrl: 'http://localhost:8080' };
9+
const props = { brokerUrl: 'ws://broker.mqttdashboard.com:8000/mqtt' };
1010

1111
render(<WorkflowManager {...props} />);
1212
});

src/contexts/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MqttClient } from 'precompiled-mqtt';
1+
import { MqttClient } from 'mqtt-browser';
22

33
export interface IMqttContext {
44
client: MqttClient | null;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
IClientOptions,
66
IClientSubscribeOptions,
77
MqttClient,
8-
} from 'precompiled-mqtt';
8+
} from 'mqtt-browser';
99

1010
type Topic = string | string[];
1111

src/utils/shouldSubscribeOrUnsubscribe.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Store } from '@reduxjs/toolkit';
2-
import { MqttClient } from 'precompiled-mqtt';
2+
import { MqttClient } from 'mqtt-browser';
33
import invariant from 'tiny-warning';
44

55
import { ERROR_MESSAGES } from './constants.util';

yarn.lock

Lines changed: 43 additions & 428 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)