f17cc4d190
## Split twenty-sdk build into separate Node and browser targets The SDK was bundling Node.js code (CLI, SDK API) and browser code (UI components, front-component renderer) through a single Vite config. This caused incorrect externalization — Node builtins leaked into browser bundles and browser-specific chunking logic applied to CLI output. This PR splits the build into `vite.config.node.ts` and `vite.config.browser.ts` so each target gets the right externals and output format. Also includes a few housekeeping renames: - `front-component` export path → `front-component-renderer` (matches what it actually is) - `front-component-common` merged into `front-component-api` (was a needless extra module)
19 lines
349 B
TypeScript
19 lines
349 B
TypeScript
import { useEffect } from 'react';
|
|
|
|
type FrontComponentErrorEffectProps = {
|
|
error: Error | null;
|
|
onError: (error: Error) => void;
|
|
};
|
|
export const FrontComponentErrorEffect = ({
|
|
error,
|
|
onError,
|
|
}: FrontComponentErrorEffectProps) => {
|
|
useEffect(() => {
|
|
if (error) {
|
|
onError(error);
|
|
}
|
|
}, [error, onError]);
|
|
|
|
return null;
|
|
};
|