You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 13, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 13, 2023. It is now read-only.
There's no option to generate .ts files at the moment. Is there some problem arising from having .tsx files? In theory they should be just picked up like .ts files are.
It’s trivial to get it to work. It’s just some tooling needs to be updated to work with tsx, but I figure if it’s easy enough to just change the extension of the generated files it could encourage more non-react usage.
6:28:39 PM - File change detected. Starting incremental compilation...
[TS]
[TS] src/repositories/AppRepository.ts(25,8): error TS6142: Module '../FirebaseSchema.gen' was resolved to '/Users/allennelso
n/workspace/draftbit/draftbit/server/src/FirebaseSchema.gen.tsx', but '--jsx' is not set.
[TS] src/repositories/ScreenRepository.ts(23,36): error TS6142: Module '../FirebaseSchema.gen' was resolved to '/Users/allenn
elson/workspace/draftbit/draftbit/server/src/FirebaseSchema.gen.tsx', but '--jsx' is not set.
[TS] src/repositories/ScreenRepository.ts(63,8): error TS7031: Binding element 'name' implicitly has an 'any' type.
[TS] src/repositories/ScreenRepository.ts(69,42): error TS7006: Parameter 'col' implicitly has an 'any' type.
[TS]
[TS] 6:28:44 PM - Found 4 errors. Watching for file changes.
.tsx only seems like right extension if there's JSX in the output; perhaps it's possible to detect?
As a workaround, we endup adding a "js-post-build" in bsconfig and run a script that copies the files without the .tsx extension:
#!/usr/bin/env sh
set -e;
# We specify ../../src since we are inside lib/bs
# where bsb have ninja and runs "js-post-build" step
# This script isn't meant to run standalone.
genFiles=$(find ../../src -iregex '.*\.gen\.tsx$');
for pth in $genFiles; do
cp "$pth" "$(sed 's/.gen.tsx/.gen.ts/' <<< "$pth")";
done
You can try release 3.43, and add "generatedFileExtension": ".gen.ts" under "gentypeconfig".
This option stays experimental, try only for specific use cases.
Reacted by David Sancho and Peter Piekarczyk
Reacted by Peter Piekarczyk
Reacted by Peter Piekarczyk, Allen Nelson and Akshay Nair
Activity
cristianoc commentedon Aug 20, 2020
There's no option to generate
.tsfiles at the moment. Is there some problem arising from having.tsxfiles? In theory they should be just picked up like.tsfiles are.chrischen commentedon Aug 20, 2020
It’s trivial to get it to work. It’s just some tooling needs to be updated to work with tsx, but I figure if it’s easy enough to just change the extension of the generated files it could encourage more non-react usage.
adnelson commentedon Feb 5, 2021
Here's one reason why that would be helpful:
.tsxonly seems like right extension if there's JSX in the output; perhaps it's possible to detect?davesnx commentedon Feb 8, 2021
As a workaround, we endup adding a "js-post-build" in bsconfig and run a script that copies the files without the
.tsxextension:Extend experimental option to specify the full extension of generated…
Extend experimental option to specify the full extension of generated…
Extend experimental option to specify the full extension of generated…
cristianoc commentedon Feb 9, 2021
You can try release 3.43, and add
"generatedFileExtension": ".gen.ts"under"gentypeconfig".This option stays experimental, try only for specific use cases.
adnelson commentedon Feb 10, 2021
@cristianoc just upgraded and it seems like it works perfectly, thanks! 😄
cristianoc commentedon Feb 12, 2021
Great!