@checkstack/notification-frontend 0.4.7 → 0.5.1

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,89 @@
1
1
  # @checkstack/notification-frontend
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [13373ce]
8
+ - @checkstack/common@0.14.0
9
+ - @checkstack/auth-frontend@0.7.1
10
+ - @checkstack/frontend-api@0.7.1
11
+ - @checkstack/notification-common@1.3.1
12
+ - @checkstack/tips-frontend@0.3.1
13
+ - @checkstack/ui@1.13.1
14
+ - @checkstack/signal-frontend@0.2.1
15
+
16
+ ## 0.5.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 9dcc848: Cut initial-load JS: lazy plugin contributions, a hardened lazy-by-default contribution contract, on-demand Monaco, and a lighter icon/chart load.
21
+
22
+ - 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.
23
+ - 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.
24
+ - 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.
25
+ - 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.
26
+
27
+ BREAKING CHANGES:
28
+
29
+ - Frontend plugin contract: routes/slot contributions are lazy-by-default (`load` instead of `element`/eager elements) as described above.
30
+ - 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.
31
+
32
+ This is a beta minor.
33
+
34
+ - 9dcc848: Align workspace dependency versions and migrate React Router to v7.
35
+
36
+ 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.
37
+
38
+ 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`.
39
+
40
+ 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).
41
+
42
+ 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`.
43
+
44
+ ### Patch Changes
45
+
46
+ - 9dcc848: Move primary navigation into a left sidebar, and serve the user guide in-app.
47
+
48
+ 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`.
49
+
50
+ 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.
51
+
52
+ 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.
53
+
54
+ This is a beta minor.
55
+
56
+ - 9dcc848: Guard component animations behind isLowPower, and add a shared inline Spinner.
57
+
58
+ - `@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.
59
+ - 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.
60
+ - 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.
61
+
62
+ Normal-power behavior is unchanged; low-power rendering drops the animations.
63
+
64
+ This is a beta minor.
65
+
66
+ - Updated dependencies [9dcc848]
67
+ - Updated dependencies [9dcc848]
68
+ - Updated dependencies [9dcc848]
69
+ - Updated dependencies [9dcc848]
70
+ - Updated dependencies [9dcc848]
71
+ - Updated dependencies [9dcc848]
72
+ - Updated dependencies [9dcc848]
73
+ - Updated dependencies [9dcc848]
74
+ - Updated dependencies [9dcc848]
75
+ - Updated dependencies [9dcc848]
76
+ - Updated dependencies [9dcc848]
77
+ - Updated dependencies [9dcc848]
78
+ - Updated dependencies [9dcc848]
79
+ - @checkstack/ui@1.13.0
80
+ - @checkstack/auth-frontend@0.7.0
81
+ - @checkstack/notification-common@1.3.0
82
+ - @checkstack/common@0.13.0
83
+ - @checkstack/frontend-api@0.7.0
84
+ - @checkstack/tips-frontend@0.3.0
85
+ - @checkstack/signal-frontend@0.2.0
86
+
3
87
  ## 0.4.7
4
88
 
5
89
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/notification-frontend",
3
- "version": "0.4.7",
3
+ "version": "0.5.1",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "main": "src/index.tsx",
@@ -13,21 +13,21 @@
13
13
  "lint:code": "eslint . --max-warnings 0"
14
14
  },
15
15
  "dependencies": {
16
- "@checkstack/auth-frontend": "0.6.6",
17
- "@checkstack/common": "0.12.0",
18
- "@checkstack/frontend-api": "0.6.0",
19
- "@checkstack/notification-common": "1.2.1",
20
- "@checkstack/signal-frontend": "0.1.5",
21
- "@checkstack/tips-frontend": "0.2.6",
22
- "@checkstack/ui": "1.11.0",
23
- "lucide-react": "^0.344.0",
24
- "react": "^18.2.0",
25
- "react-router-dom": "^6.22.0"
16
+ "@checkstack/auth-frontend": "0.7.0",
17
+ "@checkstack/common": "0.13.0",
18
+ "@checkstack/frontend-api": "0.7.0",
19
+ "@checkstack/notification-common": "1.3.0",
20
+ "@checkstack/signal-frontend": "0.2.0",
21
+ "@checkstack/tips-frontend": "0.3.0",
22
+ "@checkstack/ui": "1.13.0",
23
+ "lucide-react": "^1.17.0",
24
+ "react": "^18.3.1",
25
+ "react-router-dom": "^7.16.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "typescript": "^5.0.0",
29
29
  "@types/react": "^18.2.0",
30
30
  "@checkstack/tsconfig": "0.0.7",
31
- "@checkstack/scripts": "0.3.4"
31
+ "@checkstack/scripts": "0.4.0"
32
32
  }
33
33
  }
@@ -4,7 +4,6 @@ import {
4
4
  Link2Off,
5
5
  Check,
6
6
  X,
7
- Loader2,
8
7
  ChevronDown,
9
8
  ChevronUp,
10
9
  Send,
@@ -17,6 +16,7 @@ import {
17
16
  cn,
18
17
  DynamicIcon,
19
18
  MarkdownBlock,
19
+ Spinner,
20
20
  type LucideIconName,
21
21
  } from "@checkstack/ui";
22
22
 
@@ -191,7 +191,7 @@ export function UserChannelCard({
191
191
  className="text-destructive hover:text-destructive"
192
192
  >
193
193
  {connecting ? (
194
- <Loader2 className="h-4 w-4 animate-spin" />
194
+ <Spinner size="sm" />
195
195
  ) : (
196
196
  <Link2Off className="h-4 w-4 mr-1" />
197
197
  )}
@@ -205,7 +205,7 @@ export function UserChannelCard({
205
205
  disabled={saving || connecting}
206
206
  >
207
207
  {connecting ? (
208
- <Loader2 className="h-4 w-4 animate-spin" />
208
+ <Spinner size="sm" />
209
209
  ) : (
210
210
  <Link2 className="h-4 w-4 mr-1" />
211
211
  )}
@@ -246,7 +246,7 @@ export function UserChannelCard({
246
246
  title="Send test notification"
247
247
  >
248
248
  {testing ? (
249
- <Loader2 className="h-4 w-4 animate-spin" />
249
+ <Spinner size="sm" />
250
250
  ) : (
251
251
  <Send className="h-4 w-4" />
252
252
  )}
package/src/index.tsx CHANGED
@@ -1,18 +1,13 @@
1
1
  import {
2
2
  createFrontendPlugin,
3
- createSlotExtension,
4
3
  NavbarRightSlot,
5
- UserMenuItemsSlot,
6
4
  } from "@checkstack/frontend-api";
7
5
  import {
8
6
  notificationRoutes,
9
7
  pluginMetadata,
10
8
  } from "@checkstack/notification-common";
9
+ import { Bell } from "lucide-react";
11
10
  import { NotificationBell } from "./components/NotificationBell";
12
- import { NotificationsPage } from "./pages/NotificationsPage";
13
- import { NotificationSettingsPage } from "./pages/NotificationSettingsPage";
14
- import { DeliveryAttemptsPage } from "./pages/DeliveryAttemptsPage";
15
- import { NotificationUserMenuItems } from "./components/UserMenuItems";
16
11
 
17
12
  // Plugin-extensible kind registry — domain frontends call `registerSubjectKind`
18
13
  // at module load to bind their kinds (e.g., "catalog.system") to icon + label.
@@ -42,15 +37,29 @@ export const notificationPlugin = createFrontendPlugin({
42
37
  routes: [
43
38
  {
44
39
  route: notificationRoutes.routes.home,
45
- element: <NotificationsPage />,
40
+ load: () =>
41
+ import("./pages/NotificationsPage").then((m) => ({
42
+ default: m.NotificationsPage,
43
+ })),
46
44
  },
47
45
  {
48
46
  route: notificationRoutes.routes.settings,
49
- element: <NotificationSettingsPage />,
47
+ load: () =>
48
+ import("./pages/NotificationSettingsPage").then((m) => ({
49
+ default: m.NotificationSettingsPage,
50
+ })),
51
+ nav: {
52
+ group: "Configuration",
53
+ icon: Bell,
54
+ label: "Notification Settings",
55
+ },
50
56
  },
51
57
  {
52
58
  route: notificationRoutes.routes.deliveryAttempts,
53
- element: <DeliveryAttemptsPage />,
59
+ load: () =>
60
+ import("./pages/DeliveryAttemptsPage").then((m) => ({
61
+ default: m.DeliveryAttemptsPage,
62
+ })),
54
63
  },
55
64
  ],
56
65
  extensions: [
@@ -59,10 +68,5 @@ export const notificationPlugin = createFrontendPlugin({
59
68
  slot: NavbarRightSlot,
60
69
  component: NotificationBell,
61
70
  },
62
- createSlotExtension(UserMenuItemsSlot, {
63
- id: "notification.user.setting",
64
- component: NotificationUserMenuItems,
65
- metadata: { group: "Configuration" },
66
- }),
67
71
  ],
68
72
  });
@@ -1,16 +0,0 @@
1
- import { Link } from "react-router-dom";
2
- import { Bell } from "lucide-react";
3
- import type { UserMenuItemsContext } from "@checkstack/frontend-api";
4
- import { DropdownMenuItem } from "@checkstack/ui";
5
- import { resolveRoute } from "@checkstack/common";
6
- import { notificationRoutes } from "@checkstack/notification-common";
7
-
8
- export const NotificationUserMenuItems = (_props: UserMenuItemsContext) => {
9
- return (
10
- <Link to={resolveRoute(notificationRoutes.routes.settings)}>
11
- <DropdownMenuItem icon={<Bell className="h-4 w-4" />}>
12
- Notification Settings
13
- </DropdownMenuItem>
14
- </Link>
15
- );
16
- };