16033e9f99
- `frontComponentHostCommunicationApi` gets a new object reference on every render, causing the `useMemo`/`useEffect` in `FrontComponentWorkerEffect` to tear down and re-create the web worker each time. - Decouple the host API lifecycle from the worker lifecycle by moving thread.exports updates into a dedicated `FrontComponentUpdateHostCommunicationApiEffect` that mutates the thread's exports object in place via Object.assign. - Rename `FrontComponentHostCommunicationApiEffect` to `FrontComponentInitializeHostCommunicationApiEffect` for clarity. ## Before https://github.com/user-attachments/assets/6f3a5c14-2ae7-4317-82b5-1625abb4143e ## After https://github.com/user-attachments/assets/1059d6cd-e02c-4477-b3e8-8e965a716434
138 lines
3.3 KiB
TypeScript
138 lines
3.3 KiB
TypeScript
export { FrontComponentRenderer } from './host/components/FrontComponentRenderer';
|
|
export { componentRegistry } from './host/generated/host-component-registry';
|
|
export { FrontComponentErrorEffect } from './remote/components/FrontComponentErrorEffect';
|
|
export { FrontComponentInitializeHostCommunicationApiEffect } from './remote/components/FrontComponentInitializeHostCommunicationApiEffect';
|
|
export { FrontComponentUpdateContextEffect } from './remote/components/FrontComponentUpdateContextEffect';
|
|
export { FrontComponentUpdateHostCommunicationApiEffect } from './remote/components/FrontComponentUpdateHostCommunicationApiEffect';
|
|
export { FrontComponentWorkerEffect } from './remote/components/FrontComponentWorkerEffect';
|
|
export {
|
|
HtmlA,
|
|
HtmlArticle,
|
|
HtmlAside,
|
|
HtmlBlockquote,
|
|
HtmlBr,
|
|
HtmlButton,
|
|
HtmlCode,
|
|
HtmlDiv,
|
|
HtmlEm,
|
|
HtmlFooter,
|
|
HtmlForm,
|
|
HtmlH1,
|
|
HtmlH2,
|
|
HtmlH3,
|
|
HtmlH4,
|
|
HtmlH5,
|
|
HtmlH6,
|
|
HtmlHeader,
|
|
HtmlHr,
|
|
HtmlIframe,
|
|
HtmlAudio,
|
|
HtmlImg,
|
|
HtmlSource,
|
|
HtmlVideo,
|
|
HtmlInput,
|
|
HtmlLabel,
|
|
HtmlLi,
|
|
HtmlMain,
|
|
HtmlNav,
|
|
HtmlOl,
|
|
HtmlOption,
|
|
HtmlP,
|
|
HtmlPre,
|
|
HtmlSection,
|
|
HtmlSelect,
|
|
HtmlSmall,
|
|
HtmlSpan,
|
|
HtmlStrong,
|
|
HtmlTable,
|
|
HtmlTbody,
|
|
HtmlTd,
|
|
HtmlTextarea,
|
|
HtmlTfoot,
|
|
HtmlTh,
|
|
HtmlThead,
|
|
HtmlTr,
|
|
HtmlUl,
|
|
} from './remote/generated/remote-components';
|
|
export {
|
|
HtmlAElement,
|
|
HtmlArticleElement,
|
|
HtmlAsideElement,
|
|
HtmlBlockquoteElement,
|
|
HtmlBrElement,
|
|
HtmlButtonElement,
|
|
HtmlCodeElement,
|
|
HtmlDivElement,
|
|
HtmlEmElement,
|
|
HtmlFooterElement,
|
|
HtmlFormElement,
|
|
HtmlH1Element,
|
|
HtmlH2Element,
|
|
HtmlH3Element,
|
|
HtmlH4Element,
|
|
HtmlH5Element,
|
|
HtmlH6Element,
|
|
HtmlHeaderElement,
|
|
HtmlHrElement,
|
|
HtmlIframeElement,
|
|
HtmlAudioElement,
|
|
HtmlImgElement,
|
|
HtmlSourceElement,
|
|
HtmlVideoElement,
|
|
HtmlInputElement,
|
|
HtmlLabelElement,
|
|
HtmlLiElement,
|
|
HtmlMainElement,
|
|
HtmlNavElement,
|
|
HtmlOlElement,
|
|
HtmlOptionElement,
|
|
HtmlPElement,
|
|
HtmlPreElement,
|
|
HtmlSectionElement,
|
|
HtmlSelectElement,
|
|
HtmlSmallElement,
|
|
HtmlSpanElement,
|
|
HtmlStrongElement,
|
|
HtmlTableElement,
|
|
HtmlTbodyElement,
|
|
HtmlTdElement,
|
|
HtmlTextareaElement,
|
|
HtmlTfootElement,
|
|
HtmlTheadElement,
|
|
HtmlThElement,
|
|
HtmlTrElement,
|
|
HtmlUlElement,
|
|
RemoteFragmentElement,
|
|
RemoteRootElement,
|
|
} from './remote/generated/remote-elements';
|
|
export type {
|
|
HtmlAProperties,
|
|
HtmlButtonProperties,
|
|
HtmlCommonEvents,
|
|
HtmlCommonProperties,
|
|
HtmlFormProperties,
|
|
HtmlIframeProperties,
|
|
HtmlAudioProperties,
|
|
HtmlImgProperties,
|
|
HtmlSourceProperties,
|
|
HtmlVideoProperties,
|
|
HtmlInputProperties,
|
|
HtmlLabelProperties,
|
|
HtmlOptionProperties,
|
|
HtmlSelectProperties,
|
|
HtmlTdProperties,
|
|
HtmlTextareaProperties,
|
|
HtmlThProperties,
|
|
} from './remote/generated/remote-elements';
|
|
export { createRemoteWorker } from './remote/worker/utils/createRemoteWorker';
|
|
export { installStyleBridge } from './polyfills/installStyleBridge';
|
|
export { exposeGlobals } from './remote/utils/exposeGlobals';
|
|
export type { FrontComponentExecutionContext } from 'twenty-sdk';
|
|
export type { FrontComponentHostCommunicationApi } from './types/FrontComponentHostCommunicationApi';
|
|
export type {
|
|
HostToWorkerRenderContext,
|
|
SdkClientUrls,
|
|
} from './types/HostToWorkerRenderContext';
|
|
export type { PropertySchema } from './constants/PropertySchema';
|
|
export type { WorkerExports } from './types/WorkerExports';
|