Closed jjjorgina closed 9 months ago
The protolib
library exports React components in its default export file (index.tsx
). When you use the protolib library in a backend application (such as apps/api, which is an ExpressJS app), it's unable to compile React components.
To circumvent this issue, you should specify a more specific path to your component, ensuring that the default export file in that subdirectory (N level deep) does not export any React components.
eg.
✅ import { Protofy } from "protolib/base"
❌ import { Protofy } from "protolib"
).
Problem/Need To Be Solved
The current
protofy
starter project provides a JSX generic API for frontend (React) usage exported in Protolib Package. However, there's a need to extend its functionality to include a TypeScript-friendly generic API for backend usage. This feature request aims to address this need. This feature request does not aim to replace or remove the existing JSX generic API but rather to complement it with TypeScript support.Solution Suggestion
Additional resources
We find out that protolib's exported API is not compatible with IoT Router Api template. This is the current protolib package API file:
https://github.com/Protofy-xyz/Protofy/blob/main/packages/protolib/base/Api.ts