Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/apps/shell-super-app/shared/ultramodern-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ const ultramodernBuildArtifact = resolveUltramodernBuildArtifact(
);

export const ultramodernDeliveryUnit = ultramodernBuildArtifact.deliveryUnit;
export const ultramodernUiMarker = ultramodernBuildArtifact.surfaces.ui;
4 changes: 3 additions & 1 deletion app/apps/shell-super-app/src/routes/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Outlet } from '@modern-js/plugin-tanstack/runtime';

import { ultramodernUiMarker } from '../../shared/ultramodern-build.ts';

import './ui-kit.css';
import './index.css';

const Layout = () => (
<div data-app-id="shell-super-app">
<div data-app-id="shell-super-app" data-build-marker={ultramodernUiMarker.build}>
<Outlet />
</div>
);
Expand Down
8 changes: 8 additions & 0 deletions app/apps/shell-super-app/tests/unit/layout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { afterEach, expect, it, rstest, test } from 'effect-rstest';
import type { ComponentProps, ReactNode } from 'react';

import { AppIdSchema } from '../../shared/api';
import { ultramodernUiMarker } from '../../shared/ultramodern-build.ts';
import Layout from '../../src/routes/layout';
import { AuthenticatedDashboardLayout } from '../../src/routes/shell-frame';

Expand Down Expand Up @@ -153,6 +154,13 @@ test('leaves route content free of global user-perceivable UI', () => {
expect(document.body.textContent?.trim()).toBe('Current route');
});

test('marks every server-rendered Shell route with its UI release marker', () => {
const { container } = render(<Layout />);

const root = container.querySelector<HTMLElement>('[data-app-id="shell-super-app"]');
expect(root?.dataset['buildMarker']).toBe(ultramodernUiMarker.build);
});

test('renders the default Home dashboard contract and preserves page children', () => {
render(
<AuthenticatedDashboardLayout
Expand Down
14 changes: 14 additions & 0 deletions app/verticals/party-registry/src/routes/[lang]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Outlet } from '@modern-js/plugin-tanstack/runtime';
import type { ReactElement } from 'react';

import { ultramodernUiMarker } from '../../../shared/ultramodern-build.ts';

// Pages under this layout double as Shell module pages, so the UI release marker lives here,
// where only this vertical's own Worker renders it; the root layout stays the generated scaffold.
const LanguageLayout = (): ReactElement => (
<div data-build-marker={ultramodernUiMarker.build}>
<Outlet />
</div>
);

export default LanguageLayout;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { cleanup, render } from '@testing-library/react';
import { afterEach, expect, rstest, test } from 'effect-rstest';

import { ultramodernUiMarker } from '../../shared/ultramodern-build.ts';
import LanguageLayout from '../../src/routes/[lang]/layout.tsx';

rstest.mock('@modern-js/plugin-tanstack/runtime', () => ({
Outlet: () => <main>Current route</main>,
}));

afterEach(cleanup);

test('marks every localized Party Registry route with its UI release marker', () => {
const { container } = render(<LanguageLayout />);

const root = container.querySelector<HTMLElement>('[data-build-marker]');
expect(root?.dataset['buildMarker']).toBe(ultramodernUiMarker.build);
expect(root?.textContent).toBe('Current route');
});
Loading