Thank you for a great project, learned a lot from it. ๐
Currently, we have TypeScript setup in all the places except www
.
But most of our TypeScript code is in component
and core
, and both mobile
and web
are only referencing on component
.
Right now, mobile
doesn't have any TypeScript in it. And I was actually surprised to see it's working without an rn-cli.config.js
to do react-native-typescript-transformer
. (I see react-native-typescript-transformer
listed in component/packages.json
, but it's never used anywhere.)
web
has one index.tsx
, but in order for that to work, we need a config-overrides.js
which took me a long time to understand ๐ญ . I'm guessing it's there for TypeScript support and also references source files outside of web/src
. I have some questions regarding it.
- Isn't
react-scripts
already working with typescript?
react-app-rewired
says they don't support CRA2, should we consider switching to customize-cra
, for readability. ๐
const {
override,
babelInclude
} = require("customize-cra");
const path = require('path');
module.exports = override(
babelInclude([
path.resolve("src"),
path.resolve("../component/src"),
path.resolve("../core/src"),
])
);
In the component
repo, we are doing yarn tsc -w
, but I don't think we are using the dist folder anywhere right? Because we are always referencing @devhub/component/src/component/App
.
How would you feel about the following two options?
Option 1
- In
components/tsconfig.json
, change jsx
to react
.
- Then referencing
@devhub/components/dist/App
in web and mobile.
- Remove typescripts from
mobile
, web
and perhaps root
.
- Remove
react-app-rewired
altogether because we no longer need to include source files outside of web/src
for babel to compile.
And optionally, we need to find a way to surface Typescript error on the web page.
With this option, we can also benefit from it in #47 because it'd be less code to duplicate. ๐
Option 2
- Remove TypeScript from
component
and core
and have TypeScript setup in all the shell workspaces.
- And reference
.ts
code directly in shell projects?
Again, thank you for an awesome project. would love to learn more context behind it.