@checkstack/gitops-frontend 0.4.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# @checkstack/gitops-frontend
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9dcc848: Cut initial-load JS: lazy plugin contributions, a hardened lazy-by-default contribution contract, on-demand Monaco, and a lighter icon/chart load.
|
|
8
|
+
|
|
9
|
+
- Lazy plugin route pages: each plugin's route `element` references a `React.lazy`-wrapped page rendered inside a shared `<Suspense>` boundary. Plugins still register synchronously, so nav, slots, commands, API factories, and `foreignSignals` are available on first paint. This moves ~37 route-page chunks (~600 KB) out of the entry; the entry chunk drops from ~2.4 MB to ~190 KB. Auth flow pages stay eager. The `@checkstack/scripts` scaffold template generates lazy route pages too.
|
|
10
|
+
- Hardened contribution contract (BREAKING, frontend plugin contract): plugins declare contributions lazily and let the framework own code-splitting, Suspense, and per-plugin error isolation. Routes use `load: () => import("./Page").then((m) => ({ default: m.Page }))` instead of `element: <Page />` (`element` is still accepted for the rare page that must paint without a chunk fetch; provide exactly one). Slot extensions accept either an eager `component` or a lazy `load`; new `getLazyContribution` + `ExtensionComponent` exports from `@checkstack/frontend-api` render either kind. This also fixes runtime-installed plugins: `ExtensionSlot` subscribes to the plugin registry, and the API registry rebuilds when the plugin set changes (`getPlugins()` returns an immutable snapshot via `useSyncExternalStore`). A per-plugin error boundary contains a bad contribution.
|
|
11
|
+
- On-demand Monaco: the `@checkstack/ui` barrel no longer pulls the `@codingame/*` / `monaco-languageclient` stack into the initial load. `CodeEditor` lazy-loads its Monaco-backed editor behind `React.lazy` + Suspense, `validateTypeScriptSources` imports the editor API via in-body `await import(...)`, and the "vscode services ready" signal moved to a Monaco-free module. The ~10 MB editor body loads only when a `CodeEditor` mounts. A `react-vendor` `manualChunks` split was added for stable vendor caching.
|
|
12
|
+
- lucide-react 1.x + lighter icons/charts (BREAKING for icon consumers): lucide-react unified from three drifting ranges to `^1.17.0`. lucide v1 removed brand icons, so the GitHub/GitLab marks are vendored in `@checkstack/ui` (`GithubIcon`, `GitlabIcon`, `brandIcons`); a new `IconName` type (`LucideIconName | BrandIconName`) in `@checkstack/common` is canonical, accepted by `AuthStrategy.icon` and the card components, so data-driven brand names keep working. `DynamicIcon` no longer eagerly imports lucide's ~1600-icon map (~1 MB) - it lives in a `React.lazy` `iconRegistry` chunk fetched on first data-driven render, while statically named-imported icons tree-shake normally. The recharts-backed health-check charts (~300 KB) and the `HealthCheckSystemOverview` drawer leave the initial load.
|
|
13
|
+
|
|
14
|
+
BREAKING CHANGES:
|
|
15
|
+
|
|
16
|
+
- Frontend plugin contract: routes/slot contributions are lazy-by-default (`load` instead of `element`/eager elements) as described above.
|
|
17
|
+
- Any external consumer importing a brand icon from `lucide-react` (e.g. `import { Github } from "lucide-react"`) must switch to the vendored `@checkstack/ui` brand icons or a custom SVG.
|
|
18
|
+
|
|
19
|
+
This is a beta minor.
|
|
20
|
+
|
|
21
|
+
- 9dcc848: Align workspace dependency versions and migrate React Router to v7.
|
|
22
|
+
|
|
23
|
+
BREAKING CHANGES (React Router v7): All frontend packages now depend on `react-router-dom@^7.16.0`. Previously the workspace declared four divergent ranges (`^6.20.0`, `^6.22.0`, `^7.1.1`, `^7.14.2`), which resolved both `react-router@6` and `react-router@7` into a single bundle. Everything is now unified on v7. The public imports the app uses (`BrowserRouter`, `Routes`, `Route`, `Link`, `NavLink`, `MemoryRouter`, `useNavigate`, `useParams`, `useSearchParams`, `useLocation`) are unchanged between v6 and v7, so no source rewrites were required - but any out-of-tree plugin still on react-router v6 should upgrade to v7 (see the React Router v6 -> v7 upgrade guide) to share the host's single router instance via the import map.
|
|
24
|
+
|
|
25
|
+
Other unified ranges (no API change): `react` -> `^18.3.1`, the `@orpc/*` family (`contract`, `server`, `client`, `tanstack-query`, `openapi`, `zod`) -> `^1.14.4`, and `better-auth` -> `^1.6.13`.
|
|
26
|
+
|
|
27
|
+
Removed the pre-rename `@orpc/react-query` leftover from `@checkstack/frontend-api`; its `createRouterUtils` / `RouterUtils` / `ProcedureUtils` now come from `@orpc/tanstack-query` (the package already in use).
|
|
28
|
+
|
|
29
|
+
Stale in-range runtime deps pulled up to current published versions: `hono` `^4.12.23`, `@tanstack/react-query` (+devtools) `^5.100.14`, `date-fns` `^4.4.0`, `jose` `^6.2.3`, `tar` `^7.5.16`, `semver` `^7.8.1`, `@xyflow/react` `^12.11.0`.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 9dcc848: Move primary navigation into a left sidebar, and serve the user guide in-app.
|
|
34
|
+
|
|
35
|
+
Feature navigation (a ~20-item user-menu dropdown) now lives in a persistent left sidebar (a slide-over drawer on mobile), grouped by section with the active route highlighted; the user menu keeps only account actions. A route opts into the sidebar with new `nav` metadata (`{ group, icon, label?, order?, accessRule? }`) on its registration, co-located with path + access + title. The sidebar filters entries with the same access check as page guards. `@checkstack/common` gains `isAccessRuleSatisfied` and a centralized set of in-app doc slugs (`APP_DOC_SLUGS` + `docsPath`, with a test asserting each resolves to a real docs page); `@checkstack/auth-frontend` exports `useAccessRules`.
|
|
36
|
+
|
|
37
|
+
The backend now serves the Astro Starlight docs build same-origin at `/checkstack/*` (the same artifact deployed to GitHub Pages), so the user guide is available inside the app including for self-hosted / air-gapped installs (served verbatim, no rebuild, no link rewriting; from `CHECKSTACK_DOCS_DIST`, before the SPA catch-all, degrading gracefully when absent; the Docker image builds and ships `docs/dist`; Vite proxies `/checkstack` in dev). The "Docs" link is a shell-owned external sidebar entry under the Documentation group (book icon), opening `/checkstack/user-guide/` in a new tab; the group renders even when no plugin route contributes to it.
|
|
38
|
+
|
|
39
|
+
BREAKING (plugin authors): `UserMenuItemsSlot` is no longer the way to add navigation - registering a top user-menu item no longer surfaces it anywhere. Add `nav` to the page's route instead. `UserMenuItemsBottomSlot` (account items) is unchanged. All bundled plugins have been migrated.
|
|
40
|
+
|
|
41
|
+
This is a beta minor.
|
|
42
|
+
|
|
43
|
+
- 9dcc848: Guard component animations behind isLowPower, and add a shared inline Spinner.
|
|
44
|
+
|
|
45
|
+
- `@checkstack/ui` shared components (`Tabs`, `ConfirmationModal`, `Accordion`, `CodeEditor` popout-button backdrop blur) now drop their `animate-*` / `backdrop-blur` classes when the device reports the low-power tier, matching `LoadingSpinner` / `Skeleton`. No public API change; normal-power rendering is unchanged.
|
|
46
|
+
- A new shared inline `Spinner` (`@checkstack/ui`) renders a lucide `Loader2` whose `animate-spin` is gated internally behind `usePerformance().isLowPower`, so call sites inherit the low-power guard. Props: `size` (`sm`/`md`/`lg`), `className`, rest spread to the icon; decorative by default (`aria-hidden`), `role="status"` when given `aria-label`. The hand-rolled `Loader2` button/table spinners in `HealthCheckDrawer`, `HealthCheckRunsTable`, `IncidentEditor`, `IncidentUpdateForm`, `ProviderConnectionsPage`, `MaintenanceEditor`, `MaintenanceUpdateForm`, `UserChannelCard`, and `DynamicOptionsField` are migrated onto it.
|
|
47
|
+
- Remaining unguarded `animate-*` / `animate-in` / blur classes across the auth, gitops, healthcheck, incident, integration, maintenance, and notification frontends are gated behind `usePerformance().isLowPower`, so effects degrade gracefully on low-power devices per the performance rule.
|
|
48
|
+
|
|
49
|
+
Normal-power behavior is unchanged; low-power rendering drops the animations.
|
|
50
|
+
|
|
51
|
+
This is a beta minor.
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [9dcc848]
|
|
54
|
+
- Updated dependencies [9dcc848]
|
|
55
|
+
- Updated dependencies [9dcc848]
|
|
56
|
+
- Updated dependencies [9dcc848]
|
|
57
|
+
- Updated dependencies [9dcc848]
|
|
58
|
+
- Updated dependencies [9dcc848]
|
|
59
|
+
- Updated dependencies [9dcc848]
|
|
60
|
+
- Updated dependencies [9dcc848]
|
|
61
|
+
- Updated dependencies [9dcc848]
|
|
62
|
+
- Updated dependencies [9dcc848]
|
|
63
|
+
- Updated dependencies [9dcc848]
|
|
64
|
+
- @checkstack/ui@1.13.0
|
|
65
|
+
- @checkstack/common@0.13.0
|
|
66
|
+
- @checkstack/frontend-api@0.7.0
|
|
67
|
+
- @checkstack/tips-frontend@0.3.0
|
|
68
|
+
- @checkstack/gitops-common@0.6.0
|
|
69
|
+
|
|
3
70
|
## 0.4.7
|
|
4
71
|
|
|
5
72
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/gitops-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.tsx",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@checkstack/common": "0.12.0",
|
|
17
17
|
"@checkstack/frontend-api": "0.6.0",
|
|
18
|
-
"@checkstack/gitops-common": "0.
|
|
19
|
-
"@checkstack/tips-frontend": "0.2.
|
|
20
|
-
"@checkstack/ui": "1.
|
|
21
|
-
"lucide-react": "^
|
|
22
|
-
"react": "^18.
|
|
23
|
-
"react-router-dom": "^
|
|
18
|
+
"@checkstack/gitops-common": "0.5.0",
|
|
19
|
+
"@checkstack/tips-frontend": "0.2.7",
|
|
20
|
+
"@checkstack/ui": "1.12.0",
|
|
21
|
+
"lucide-react": "^1.17.0",
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"react-router-dom": "^7.16.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "^5.0.0",
|
|
@@ -22,15 +22,11 @@ import {
|
|
|
22
22
|
Badge,
|
|
23
23
|
useToast,
|
|
24
24
|
toastError,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Plus,
|
|
28
|
-
RefreshCw,
|
|
29
|
-
Trash2,
|
|
30
|
-
Pencil,
|
|
31
|
-
Github,
|
|
25
|
+
// Brand marks were removed from lucide v1; use the vendored ones.
|
|
26
|
+
GithubIcon as Github,
|
|
32
27
|
GitlabIcon,
|
|
33
|
-
} from "
|
|
28
|
+
} from "@checkstack/ui";
|
|
29
|
+
import { Plus, RefreshCw, Trash2, Pencil } from "lucide-react";
|
|
34
30
|
import { ProviderEditor } from "./ProviderEditor";
|
|
35
31
|
|
|
36
32
|
const formatInterval = (seconds: number) => {
|
package/src/index.tsx
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createFrontendPlugin,
|
|
3
|
-
createSlotExtension,
|
|
4
|
-
UserMenuItemsSlot,
|
|
5
|
-
} from "@checkstack/frontend-api";
|
|
1
|
+
import { createFrontendPlugin } from "@checkstack/frontend-api";
|
|
6
2
|
import {
|
|
7
3
|
gitopsRoutes,
|
|
8
4
|
pluginMetadata,
|
|
9
5
|
gitopsAccess,
|
|
10
6
|
} from "@checkstack/gitops-common";
|
|
11
|
-
|
|
12
|
-
import { GitOpsPage } from "./pages/GitOpsPage";
|
|
13
|
-
import { KindRegistryPage } from "./pages/KindRegistryPage";
|
|
14
|
-
import { GitOpsMenuItem } from "./components/GitOpsMenuItem";
|
|
15
|
-
import { KindRegistryMenuItem } from "./components/KindRegistryMenuItem";
|
|
7
|
+
import { GitBranch, Blocks } from "lucide-react";
|
|
16
8
|
|
|
17
9
|
export const gitopsPlugin = createFrontendPlugin({
|
|
18
10
|
metadata: pluginMetadata,
|
|
@@ -20,27 +12,29 @@ export const gitopsPlugin = createFrontendPlugin({
|
|
|
20
12
|
routes: [
|
|
21
13
|
{
|
|
22
14
|
route: gitopsRoutes.routes.home,
|
|
23
|
-
|
|
15
|
+
load: () => import("./pages/GitOpsPage").then((m) => ({ default: m.GitOpsPage })),
|
|
24
16
|
accessRule: gitopsAccess.provider.read,
|
|
17
|
+
nav: {
|
|
18
|
+
group: "Configuration",
|
|
19
|
+
icon: GitBranch,
|
|
20
|
+
label: "GitOps",
|
|
21
|
+
},
|
|
25
22
|
},
|
|
26
23
|
{
|
|
27
24
|
route: gitopsRoutes.routes.kinds,
|
|
28
|
-
|
|
25
|
+
load: () =>
|
|
26
|
+
import("./pages/KindRegistryPage").then((m) => ({
|
|
27
|
+
default: m.KindRegistryPage,
|
|
28
|
+
})),
|
|
29
29
|
accessRule: gitopsAccess.kinds.read,
|
|
30
|
+
nav: {
|
|
31
|
+
group: "Documentation",
|
|
32
|
+
icon: Blocks,
|
|
33
|
+
label: "Kind Registry",
|
|
34
|
+
},
|
|
30
35
|
},
|
|
31
36
|
],
|
|
32
|
-
extensions: [
|
|
33
|
-
createSlotExtension(UserMenuItemsSlot, {
|
|
34
|
-
id: "gitops.user-menu.link",
|
|
35
|
-
component: GitOpsMenuItem,
|
|
36
|
-
metadata: { group: "Configuration" },
|
|
37
|
-
}),
|
|
38
|
-
createSlotExtension(UserMenuItemsSlot, {
|
|
39
|
-
id: "gitops.user-menu.kind-registry",
|
|
40
|
-
component: KindRegistryMenuItem,
|
|
41
|
-
metadata: { group: "Documentation" },
|
|
42
|
-
}),
|
|
43
|
-
],
|
|
37
|
+
extensions: [],
|
|
44
38
|
});
|
|
45
39
|
|
|
46
40
|
// Public API for other frontend plugins
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
AccordionItem,
|
|
19
19
|
AccordionTrigger,
|
|
20
20
|
AccordionContent,
|
|
21
|
+
usePerformance,
|
|
22
|
+
cn,
|
|
21
23
|
} from "@checkstack/ui";
|
|
22
24
|
import {
|
|
23
25
|
ChevronDown,
|
|
@@ -483,6 +485,8 @@ function SpecSchemaDocumentationField({
|
|
|
483
485
|
});
|
|
484
486
|
}, [docs, selections]);
|
|
485
487
|
|
|
488
|
+
const { isLowPower } = usePerformance();
|
|
489
|
+
|
|
486
490
|
const currentSelection = selections[fieldPath] || "";
|
|
487
491
|
const isValidSelection =
|
|
488
492
|
currentSelection !== "" &&
|
|
@@ -534,7 +538,13 @@ function SpecSchemaDocumentationField({
|
|
|
534
538
|
</div>
|
|
535
539
|
|
|
536
540
|
{selectedDoc ? (
|
|
537
|
-
<div
|
|
541
|
+
<div
|
|
542
|
+
className={cn(
|
|
543
|
+
"space-y-3",
|
|
544
|
+
!isLowPower &&
|
|
545
|
+
"animate-in fade-in slide-in-from-top-2 duration-200",
|
|
546
|
+
)}
|
|
547
|
+
>
|
|
538
548
|
{selectedDoc.description && (
|
|
539
549
|
<div className="text-sm text-muted-foreground">
|
|
540
550
|
<MarkdownBlock>{selectedDoc.description}</MarkdownBlock>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useNavigate } from "react-router-dom";
|
|
2
|
-
import { GitBranch } from "lucide-react";
|
|
3
|
-
import { DropdownMenuItem } from "@checkstack/ui";
|
|
4
|
-
import type { UserMenuItemsContext } from "@checkstack/frontend-api";
|
|
5
|
-
import { resolveRoute } from "@checkstack/common";
|
|
6
|
-
import { pluginMetadata, gitopsAccess, gitopsRoutes } from "@checkstack/gitops-common";
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
const REQUIRED_ACCESS_RULE = `${pluginMetadata.pluginId}.${gitopsAccess.provider.read.id}`;
|
|
10
|
-
|
|
11
|
-
export function GitOpsMenuItem({
|
|
12
|
-
accessRules: userPerms,
|
|
13
|
-
}: UserMenuItemsContext) {
|
|
14
|
-
const navigate = useNavigate();
|
|
15
|
-
const canView =
|
|
16
|
-
userPerms.includes("*") || userPerms.includes(REQUIRED_ACCESS_RULE);
|
|
17
|
-
|
|
18
|
-
if (!canView) return <React.Fragment />;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<DropdownMenuItem
|
|
22
|
-
onClick={() => navigate(resolveRoute(gitopsRoutes.routes.home))}
|
|
23
|
-
icon={<GitBranch className="h-4 w-4" />}
|
|
24
|
-
>
|
|
25
|
-
GitOps
|
|
26
|
-
</DropdownMenuItem>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useNavigate } from "react-router-dom";
|
|
2
|
-
import { Blocks } from "lucide-react";
|
|
3
|
-
import { DropdownMenuItem } from "@checkstack/ui";
|
|
4
|
-
import type { UserMenuItemsContext } from "@checkstack/frontend-api";
|
|
5
|
-
import { resolveRoute } from "@checkstack/common";
|
|
6
|
-
import { pluginMetadata, gitopsAccess, gitopsRoutes } from "@checkstack/gitops-common";
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
const REQUIRED_ACCESS_RULE = `${pluginMetadata.pluginId}.${gitopsAccess.kinds.read.id}`;
|
|
10
|
-
|
|
11
|
-
export function KindRegistryMenuItem({
|
|
12
|
-
accessRules: userPerms,
|
|
13
|
-
}: UserMenuItemsContext) {
|
|
14
|
-
const navigate = useNavigate();
|
|
15
|
-
const canView =
|
|
16
|
-
userPerms.includes("*") || userPerms.includes(REQUIRED_ACCESS_RULE);
|
|
17
|
-
|
|
18
|
-
if (!canView) return <React.Fragment />;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<DropdownMenuItem
|
|
22
|
-
onClick={() => navigate(resolveRoute(gitopsRoutes.routes.kinds))}
|
|
23
|
-
icon={<Blocks className="h-4 w-4" />}
|
|
24
|
-
>
|
|
25
|
-
Kind Registry
|
|
26
|
-
</DropdownMenuItem>
|
|
27
|
-
);
|
|
28
|
-
}
|