Skip to content

Commit 67efe1d

Browse files
committed
Merge remote-tracking branch 'origin/main' into chore/deps-minor
* origin/main: chore(release): bump version to 0.2.0-alpha.329 feat(SuspenseTrigger): added remote suspense loading trigger (#1722) # Conflicts: # apps/remote-dom-demo/package.json # pnpm-lock.yaml
2 parents 4e79d37 + 8d00ca0 commit 67efe1d

File tree

42 files changed

+1424
-1171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1424
-1171
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [0.2.0-alpha.329](https://github.com/mittwald/flow/compare/0.2.0-alpha.328...0.2.0-alpha.329) (2025-07-09)
7+
8+
### Features
9+
10+
* **SuspenseTrigger:** added remote suspense loading trigger ([#1722](https://github.com/mittwald/flow/issues/1722)) ([98e19ee](https://github.com/mittwald/flow/commit/98e19eef41cb66a0dcb5a6024eee33f1464f58d0))
11+
612
# [0.2.0-alpha.328](https://github.com/mittwald/flow/compare/0.2.0-alpha.327...0.2.0-alpha.328) (2025-07-09)
713

814
### Bug Fixes

apps/remote-dom-demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"react-hook-form": "^7.60.0",
2727
"remeda": "^2.25.0",
2828
"sass": "^1.89.2",
29+
"usehooks-ts": "^3.1.1",
2930
"webpack": "^5.99.9"
3031
},
3132
"devDependencies": {

apps/remote-dom-demo/src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default function Layout(props: PropsWithChildren) {
6363
<Link href="/host/react-hook-form">React Hook Form</Link>
6464
<Link href="/host/files">Files</Link>
6565
<Link href="/host/suspense">Suspense</Link>
66+
<Link href="/host/mstudio-loading">mStudio loading</Link>
6667
<Link href="/host/tunnel">Tunnel</Link>
6768
<Link href="/host/ext-bridge">Ext Bridge</Link>
6869
<Link href="/host/error">Error</Link>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use client";
2+
3+
import { Heading, Section, Text } from "@mittwald/flow-remote-react-components";
4+
import { LoadingIndicator } from "@mittwald/mstudio-ext-react-components";
5+
import { useState } from "react";
6+
import { useTimeout } from "usehooks-ts";
7+
8+
export default function Page() {
9+
const [loading, setIsLoading] = useState(true);
10+
const hideLoading = () => {
11+
setIsLoading(false);
12+
};
13+
useTimeout(hideLoading, 3000);
14+
console.log("Is loading?", loading);
15+
16+
return (
17+
<Section>
18+
<Heading>Demo</Heading>
19+
<Text>Some text</Text>
20+
<LoadingIndicator show={loading} />
21+
</Section>
22+
);
23+
}

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"packages": [
55
"packages/*"
66
],
7-
"version": "0.2.0-alpha.328"
7+
"version": "0.2.0-alpha.329"
88
}

packages/components/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [0.2.0-alpha.329](https://github.com/mittwald/flow/compare/0.2.0-alpha.328...0.2.0-alpha.329) (2025-07-09)
7+
8+
### Features
9+
10+
* **SuspenseTrigger:** added remote suspense loading trigger ([#1722](https://github.com/mittwald/flow/issues/1722)) ([98e19ee](https://github.com/mittwald/flow/commit/98e19eef41cb66a0dcb5a6024eee33f1464f58d0))
11+
612
# [0.2.0-alpha.328](https://github.com/mittwald/flow/compare/0.2.0-alpha.327...0.2.0-alpha.328) (2025-07-09)
713

814
### Bug Fixes

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mittwald/flow-react-components",
3-
"version": "0.2.0-alpha.328",
3+
"version": "0.2.0-alpha.329",
44
"type": "module",
55
"description": "A React implementation of Flow, mittwald’s design system",
66
"homepage": "https://mittwald.github.io/flow",

packages/components/src/components/Activity/Activity.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
import type { ComponentType, FC, PropsWithChildren } from "react";
2-
import React, { lazy, Suspense, useEffect, useState } from "react";
1+
import SuspenseTrigger from "@/components/SuspenseTrigger";
2+
import type { FC, PropsWithChildren } from "react";
3+
import { Suspense, useEffect, useState } from "react";
34
import { useIsSSR } from "react-aria";
45

56
export interface ActivityProps extends PropsWithChildren {
67
isActive?: boolean;
78
inactiveDelay?: number;
89
}
910

10-
const nonResolvingPromise = new Promise<{ default: ComponentType<unknown> }>(
11-
() => {
12-
// no resolve
13-
},
14-
);
15-
16-
const SuspenseTrigger = lazy(() => nonResolvingPromise);
17-
1811
export const Activity: FC<ActivityProps> = (props) => {
1912
const { children, isActive: isActiveFromProps = true, inactiveDelay } = props;
2013

@@ -47,7 +40,7 @@ export const Activity: FC<ActivityProps> = (props) => {
4740

4841
return (
4942
<Suspense fallback={null}>
50-
{!isActive && <SuspenseTrigger />}
43+
<SuspenseTrigger show={!isActive} />
5144
{children}
5245
</Suspense>
5346
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { lazy, type ComponentType, type FC } from "react";
2+
3+
export interface SuspenseTriggerProps {
4+
show?: boolean;
5+
}
6+
7+
const nonResolvingPromise = new Promise<{ default: ComponentType<unknown> }>(
8+
() => {
9+
// no resolve
10+
},
11+
);
12+
13+
const NonResolvingLazy = lazy(() => nonResolvingPromise);
14+
15+
/** @flr-generate all */
16+
export const SuspenseTrigger: FC<SuspenseTriggerProps> = (props) => {
17+
const { show = true } = props;
18+
return show ? <NonResolvingLazy /> : null;
19+
};
20+
21+
export default SuspenseTrigger;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./SuspenseTrigger";
2+
export { default } from "./SuspenseTrigger";

0 commit comments

Comments
 (0)