Skip to content

Commit 3665d97

Browse files
Merge pull request #605 from Shopify/changeset-release/main
Publish packages 🚀
2 parents f6d7770 + 197942c commit 3665d97

9 files changed

Lines changed: 47 additions & 25 deletions

File tree

.changeset/microtask-default-batching.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/custom-element/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# example-custom-element
22

3+
## 0.0.25
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`7177edb`](https://github.com/Shopify/remote-dom/commit/7177edbcdc67a633f879d9aa7b2956e49471a1aa)]:
8+
- @remote-dom/core@1.11.0
9+
310
## 0.0.24
411

512
### Patch Changes

examples/custom-element/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-custom-element",
3-
"version": "0.0.24",
3+
"version": "0.0.25",
44
"type": "module",
55
"private": true,
66
"scripts": {

examples/getting-started/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# example-getting-started
22

3+
## 0.0.25
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`7177edb`](https://github.com/Shopify/remote-dom/commit/7177edbcdc67a633f879d9aa7b2956e49471a1aa)]:
8+
- @remote-dom/core@1.11.0
9+
310
## 0.0.24
411

512
### Patch Changes

examples/getting-started/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-getting-started",
3-
"version": "0.0.24",
3+
"version": "0.0.25",
44
"type": "module",
55
"private": true,
66
"scripts": {

examples/kitchen-sink/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# example-kitchen-sink
22

3+
## 0.0.32
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`7177edb`](https://github.com/Shopify/remote-dom/commit/7177edbcdc67a633f879d9aa7b2956e49471a1aa)]:
8+
- @remote-dom/core@1.11.0
9+
310
## 0.0.31
411

512
### Patch Changes

examples/kitchen-sink/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "example-kitchen-sink",
33
"type": "module",
44
"private": true,
5-
"version": "0.0.31",
5+
"version": "0.0.32",
66
"scripts": {
77
"start": "vite"
88
},

packages/core/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# @remote-dom/core
22

3+
## 1.11.0
4+
5+
### Minor Changes
6+
7+
- [#604](https://github.com/Shopify/remote-dom/pull/604) [`7177edb`](https://github.com/Shopify/remote-dom/commit/7177edbcdc67a633f879d9aa7b2956e49471a1aa) Thanks [@justinhenricks](https://github.com/justinhenricks)! - Flush `BatchingRemoteConnection` mutations on a microtask by default
8+
9+
The default `batch` function used by `BatchingRemoteConnection` now schedules flushes on a microtask (via `queueMicrotask`, falling back to `Promise.resolve().then(...)`) instead of a macrotask via `MessageChannel`/`setTimeout`.
10+
11+
This ensures that DOM mutations made in the remote environment are delivered to the host before any `await`ed RPC response resolves, avoiding a class of bugs where the host sees an RPC result before the element updates that produced it (for example, a `perform()` callback setting an error on a field, only to have the host run its post-`await` logic before that error mutation arrives).
12+
13+
If you were relying on the previous macrotask behavior, you can restore it by passing a custom `batch` option, e.g.:
14+
15+
```ts
16+
new BatchingRemoteConnection(connection, {
17+
batch: (flush) => {
18+
const channel = new MessageChannel();
19+
channel.port1.onmessage = () => flush();
20+
channel.port2.postMessage(null);
21+
},
22+
});
23+
```
24+
325
## 1.10.1
426

527
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"access": "public",
88
"@remote-dom/registry": "https://registry.npmjs.org"
99
},
10-
"version": "1.10.1",
10+
"version": "1.11.0",
1111
"engines": {
1212
"node": ">=14.0.0"
1313
},

0 commit comments

Comments
 (0)