Skip to content

7.2.0

Compare
Choose a tag to compare
@github-actions github-actions released this 22 Aug 10:58
· 382 commits to main since this release
ac01c5a

@comet/[email protected]

Minor Changes

  • 0fb8d9a: Allow pinning DataGrid columns using the column config when using DataGridPro or DataGridPremium with the usePersistentColumnState hook

    const columns: GridColDef[] = [
        {
            field: "title",
            pinned: "left",
        },
        // ... other columns
        {
            field: "actions",
            pinned: "right",
        },
    ];

Patch Changes

  • 4b267f9: Fix broken export/import of commonErrorMessages from the file form field

@comet/[email protected]

Minor Changes

  • 9b800c9: Slightly adjust the styling of pinned columns in DataGrid

@comet/[email protected]

Minor Changes

  • 381aa71: Add ErrorHandlerProvider

    Each block in BlocksBlock, OneOfBlock and ListBlock is wrapped with an error boundary to prevent the whole page from crashing when a single block throws an error.
    In production, the broken block is hidden. The application should take care of reporting the error to an error tracking service (e.g., Sentry). In local development, the error is re-thrown.

    Add an ErrorHandler to the root layout:

    // In src/app/layout.tsx
    <html>
        <body className={inter.className}>
            {/* Other Providers */}
            <ErrorHandler>{children}</ErrorHandler>
        </body>
    </html>

    The ErrorHandler receives the errors in the application and can report them to the error tracking service.

    Example ErrorHandler

    "use client";
    
    import { ErrorHandlerProvider } from "@comet/cms-site";
    import { PropsWithChildren } from "react";
    
    export function ErrorHandler({ children }: PropsWithChildren) {
        function onError(error: Error, errorInfo: ErrorInfo) {
            console.error("Error caught by error handler", error, errorInfo.componentStack);
            if (process.env.NODE_ENV === "development") {
                throw error;
            } else {
                // Report the error to the error tracking service
            }
        }
    
        return <ErrorHandlerProvider onError={onError}>{children}</ErrorHandlerProvider>;
    }

@comet/[email protected]

Patch Changes

  • 4b267f9: Fix broken export/import of commonErrorMessages from the file form field