UNPKG

@jay-js/system

Version:

A powerful and flexible TypeScript library for UI, state management, lazy loading, routing and managing draggable elements in modern web applications.

34 lines 1.41 kB
/** * @file JSX Development Runtime implementation for Jay JS * @description Provides the JSX transformation functions for development use */ import { Base, Fragment } from "../../core/index.js"; /** * JSX Development transformation function * This function is used by the JSX compiler in development mode * * @param tag - HTML tag name or component function * @param props - Element properties and attributes * @param key - Unique key for element identification * @param isStaticChildren - Whether children are static * @param source - Source information for development tools * @param self - Self reference for development tools * @returns HTMLElement or Promise<HTMLElement> */ function jayJSXDEV(tag, props, _key, _isStaticChildren, _source, _self) { if (typeof tag === "function") { return tag(Object.assign({}, props)); // Uncomment if async handling needs improvement // const result = tag({ ...props }); // if (result instanceof Promise) { // return Promise.resolve(result); // } // return result as HTMLElement; } // Use type assertion to get around type checking issues // This is safe because base component expects tag to be a valid HTML tag const element = Base(Object.assign({ tag }, props)); return element; } export { jayJSXDEV as jsxDEV, Fragment }; //# sourceMappingURL=jsx-dev-runtime.js.map