Closed whitphx closed 4 months ago
Option: to create a new package packages/streamlit-browser
that imports the TS files from /streamlit/frontend/src
and transpile and export them.
Only this package needs importing external files, however, other packages can use the precompiled code from this package.
Now the Streamlit's frontend is split into lib
and app
, and lib
behaves like what this issue suggests.
app
doesn't, but it's an intended design of it.
Currently we configured some packages to directly import the TypeScript files from the
streamlit-browser
package at/streamlit/frontend/src
by using CRACO or overriding the ejected config file, however, obviously it violates the default configuration of Create-React-App. NextJS also has this restriction and we encountered it at https://github.com/whitphx/stlite/issues/68#issuecomment-1236484736 and found that this designed is intended to avoid many potential problems. To follow this standard, we should change the strategy to precompile the TS files in/streamlit/frontend/src
and import the transpiled JS files from other packages.To do it simply, just changing
tsconfig.json
as belowand running
yarn tsc
failed with the errors following:We have to deal with it.