Skip to content

Commit 4442833

Browse files
committed
Bug: Fix isServer rewrite broke async blocks
1 parent fae011b commit 4442833

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

RELEASE-NOTES.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,30 @@ This is a pre-release version and APIs will change quickly. Before `1.0` release
66

77
Please note after `1.0` Semver will be followed using normal protocols.
88

9-
# Version 0.13.4 - xx.xx.xxxx
9+
# Version 0.14.0 - 07.22.2025
1010

11-
### Component
11+
## Components
1212
* **Enhancement** - Component navigation helpers (`findChild`, `findChildren`, `findParent`, `findTemplate`) now have comprehensive support for both web components and subtemplates using dual pattern traversal
1313
* **Enhancement** - `findChild` and `findChildren` now properly find nested web components across shadow DOM boundaries using deep shadow DOM traversal
1414
* **Bug** - Fixed `findTemplate` to return consistent merged component data format (containing both instance and data properties) matching other navigation helpers instead of raw Template object
1515

16+
## Templates
17+
* **Bug** - Fix error causing async blocks to stop working
18+
1619
### Testing
1720
* **Improvement** - Disabled screenshot capture on test failures across all packages to prevent unwanted screenshot directories
1821

1922
### Utils
23+
* **Breaking Change** - `debounce` function signature changed from `debounce(fn, options)` to `debounce(func, wait, options)`
2024
* **Feature** - Enhanced `debounce` function with full async support, promise sharing, AbortController integration, and new options (`leading`, `trailing`, `maxWait`, `rejectSkipped`)
2125
* **Feature** - Added new `throttle` function with async support, promise sharing, AbortController integration, and configurable leading/trailing execution
2226
* **Feature** - Added `getIPAddress()` to retrieve local, public, or all IP addresses using WebRTC ICE gathering
23-
* **Breaking** - `debounce` function signature changed from `debounce(fn, options)` to `debounce(func, wait, options)` for consistency and enhanced functionality
2427
* **Bug** - Fixed `fatal` to look for `onError` on `globalThis`
2528

2629
### Documentation
2730
* **Examples** - Added missing examples for browser utilities: `copyText`, `openLink`, `getKeyFromEvent`, `idleCallback`, `getText`, and `getJSON`
2831

2932
# Version 0.13.3 - 07.17.2025
30-
3133
* **Improvement/Bug** - Fix issue where some build tools could not parse raw text imports of dependencies. There is now a build step where esm endpoints now inline txt imports.
3234

3335

packages/renderer/src/lit/directives/reactive-async.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AsyncDirective } from 'lit/async-directive.js';
33
import { directive } from 'lit/directive.js';
44

55
import { Reaction } from '@semantic-ui/reactivity';
6-
import { isPromise, isPlainObject, each } from '@semantic-ui/utils';
6+
import { each, isClient, isPlainObject, isPromise } from '@semantic-ui/utils';
77

88
export class ReactiveAsyncDirective extends AsyncDirective {
99
constructor(partInfo) {
@@ -22,16 +22,15 @@ export class ReactiveAsyncDirective extends AsyncDirective {
2222
}
2323

2424
// Create a new reaction that watches for reactive changes on client
25-
if(isClient) {
26-
this.watchChanges();
25+
if (isClient) {
26+
this.watchChanges(asyncCondition);
2727
}
2828

2929
// Return initial render
3030
return this.renderCurrentState(asyncCondition);
3131
}
3232

33-
watchChanges() {
34-
33+
watchChanges(asyncCondition) {
3534
// pass through context for debugging
3635
let context = {
3736
message: `async block: {#async ${asyncCondition.expression}}`,
@@ -103,7 +102,7 @@ export class ReactiveAsyncDirective extends AsyncDirective {
103102
case 'error':
104103
if (asyncCondition.errorContent) {
105104
// Create data context with error
106-
const errorData = asyncCondition.errorAs
105+
const errorData = asyncCondition.errorAs
107106
? { [asyncCondition.errorAs]: this.error }
108107
: { this: this.error };
109108

@@ -135,7 +134,7 @@ export class ReactiveAsyncDirective extends AsyncDirective {
135134
// Handle {#async expression as { prop1, prop2, ...rest }}
136135
if (asyncCondition.parts && isPlainObject(value)) {
137136
const data = {};
138-
137+
139138
// Extract specified properties
140139
each(asyncCondition.parts, (prop) => {
141140
if (prop in value) {

0 commit comments

Comments
 (0)