Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node22-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-node22-
- run: npm ci --legacy-peer-deps
- run: npm run lint

Expand All @@ -37,23 +37,23 @@ jobs:
needs: [lintjs]
strategy:
matrix:
node: [16, 18, 20]
node: [22, 24]
steps:
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}
${{ runner.os }}-node${{ matrix.node }}-
- run: npm ci --legacy-peer-deps
- run: npm run test:coverage

Expand All @@ -63,11 +63,11 @@ jobs:
needs: [unittest]
strategy:
matrix:
node: [16, 18, 20]
node: [22, 24]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm run build --if-present
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
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.
</p>

> Please note: this repo will migrate to ESM-only end of 2025. Please prepare your projects accordingly.

<p align="center">
<a href="https://guide.meteor.com/react-native.html">Meteor Guide</a>
<span>·</span>
Expand Down
13 changes: 7 additions & 6 deletions helpers/reactNativeBindings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const bindings = {};
let batchedUpdates;
let runAfterInteractions;

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

try {
require.resolve('react-native');
bindings.batchedUpdates =
batchedUpdates =
require('react-native/Libraries/Renderer/shims/ReactNative').unstable_batchedUpdates;
bindings.runAfterInteractions =
runAfterInteractions =
require('react-native').InteractionManager.runAfterInteractions;
} catch (e) {
// if the module is not installed (for example when running tests)
// we fall back to some defaults that seem to be close to what
// the original functions implement
bindings.batchedUpdates = (cb) => cb();
bindings.runAfterInteractions = (fn) => setTimeout(() => fn(), 50);
batchedUpdates = (cb) => cb();
runAfterInteractions = (fn) => setTimeout(() => fn(), 50);
}

module.exports = bindings;
export { batchedUpdates, runAfterInteractions };
2 changes: 1 addition & 1 deletion lib/Random.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const UNMISTAKABLE_CHARS =
'23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz';

module.exports = {
export default {
/**
* Generates a random id-string of given length.
* The string will consist of characters from the following list:
Expand Down
6 changes: 3 additions & 3 deletions lib/ddp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import EventEmitter from 'eventemitter3';
import Queue from './queue';
import Socket from './socket';
import { uniqueId } from './utils';
import Queue from './queue.js';
import Socket from './socket.js';
import { uniqueId } from './utils.js';

/**
* This is the latest version, of the protocol we use
Expand Down
2 changes: 1 addition & 1 deletion lib/mongo-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ MongoID.idParse = function idParse(id) {
}
};

module.exports = MongoID;
export default MongoID;
2 changes: 1 addition & 1 deletion lib/socket.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EventEmitter from 'eventemitter3';
import EJSON from 'ejson';
import './mongo-id'; // Register mongo object ids */
import './mongo-id.js'; // Register mongo object ids */

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

Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SHA256 } from './sha256';
import { SHA256 } from './sha256.js';

var i = 0;

Expand Down
Loading