Skip to content

Commit 955e7fe

Browse files
committed
Merge branch 'master' into fix/event-emit
2 parents 0ead540 + e84574c commit 955e7fe

29 files changed

+2173
-2967
lines changed

.github/workflows/node.js.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v5
1818

1919
- name: setup node
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20
22+
node-version: 22
2323

2424
- name: cache dependencies
25-
uses: actions/cache@v3
25+
uses: actions/cache@v4
2626
with:
2727
path: ~/.npm
28-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28+
key: ${{ runner.os }}-node22-${{ hashFiles('**/package-lock.json') }}
2929
restore-keys: |
30-
${{ runner.os }}-node-
30+
${{ runner.os }}-node22-
3131
- run: npm ci --legacy-peer-deps
3232
- run: npm run lint
3333

@@ -37,23 +37,23 @@ jobs:
3737
needs: [lintjs]
3838
strategy:
3939
matrix:
40-
node: [16, 18, 20]
40+
node: [22, 24]
4141
steps:
4242
- name: Checkout ${{ matrix.node }}
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v5
4444

4545
- name: Setup node ${{ matrix.node }}
46-
uses: actions/setup-node@v3
46+
uses: actions/setup-node@v4
4747
with:
4848
node-version: ${{ matrix.node }}
4949

5050
- name: Cache dependencies ${{ matrix.node }}
51-
uses: actions/cache@v3
51+
uses: actions/cache@v4
5252
with:
5353
path: ~/.npm
54-
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
54+
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
5555
restore-keys: |
56-
${{ runner.os }}-node-${{ matrix.node }}
56+
${{ runner.os }}-node${{ matrix.node }}-
5757
- run: npm ci --legacy-peer-deps
5858
- run: npm run test:coverage
5959

@@ -63,11 +63,11 @@ jobs:
6363
needs: [unittest]
6464
strategy:
6565
matrix:
66-
node: [16, 18, 20]
66+
node: [22, 24]
6767
steps:
68-
- uses: actions/checkout@v3
68+
- uses: actions/checkout@v5
6969
- name: Use Node.js ${{ matrix.node-version }}
70-
uses: actions/setup-node@v3
70+
uses: actions/setup-node@v4
7171
with:
7272
node-version: ${{ matrix.node-version }}
7373
- run: npm run build --if-present

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
Connect your React Native app to your Meteor server, and take advantage of Meteor-specific features like accounts, reactive data trackers, etc. Compatible with the latest version of React Native.
2626
</p>
2727

28+
> Please note: this repo will migrate to ESM-only end of 2025. Please prepare your projects accordingly.
29+
2830
<p align="center">
2931
<a href="https://guide.meteor.com/react-native.html">Meteor Guide</a>
3032
<span>·</span>

helpers/reactNativeBindings.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const bindings = {};
1+
let batchedUpdates;
2+
let runAfterInteractions;
23

34
// TODO:
45
// we should consider implementing an injection-based pattern for
@@ -11,16 +12,16 @@ const bindings = {};
1112

1213
try {
1314
require.resolve('react-native');
14-
bindings.batchedUpdates =
15+
batchedUpdates =
1516
require('react-native/Libraries/Renderer/shims/ReactNative').unstable_batchedUpdates;
16-
bindings.runAfterInteractions =
17+
runAfterInteractions =
1718
require('react-native').InteractionManager.runAfterInteractions;
1819
} catch (e) {
1920
// if the module is not installed (for example when running tests)
2021
// we fall back to some defaults that seem to be close to what
2122
// the original functions implement
22-
bindings.batchedUpdates = (cb) => cb();
23-
bindings.runAfterInteractions = (fn) => setTimeout(() => fn(), 50);
23+
batchedUpdates = (cb) => cb();
24+
runAfterInteractions = (fn) => setTimeout(() => fn(), 50);
2425
}
2526

26-
module.exports = bindings;
27+
export { batchedUpdates, runAfterInteractions };

lib/Random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const UNMISTAKABLE_CHARS =
22
'23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz';
33

4-
module.exports = {
4+
export default {
55
/**
66
* Generates a random id-string of given length.
77
* The string will consist of characters from the following list:

lib/ddp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import EventEmitter from 'eventemitter3';
2-
import Queue from './queue';
3-
import Socket from './socket';
4-
import { uniqueId } from './utils';
2+
import Queue from './queue.js';
3+
import Socket from './socket.js';
4+
import { uniqueId } from './utils.js';
55

66
/**
77
* This is the latest version, of the protocol we use

lib/mongo-id.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ MongoID.idParse = function idParse(id) {
122122
}
123123
};
124124

125-
module.exports = MongoID;
125+
export default MongoID;

lib/socket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import EventEmitter from 'eventemitter3';
22
import EJSON from 'ejson';
3-
import './mongo-id'; // Register mongo object ids */
3+
import './mongo-id.js'; // Register mongo object ids */
44

55
const events = ['open', 'close', 'message:in', 'message:out'];
66

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SHA256 } from './sha256';
1+
import { SHA256 } from './sha256.js';
22

33
var i = 0;
44

0 commit comments

Comments
 (0)