-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack & tsc plugins #160
Comments
Reminds me of this for CSS Modules: https://github.com/timothykang/css-module-types |
How would this work when we run
I think we'd still need to manually compile translation JSON to TS before we run Related TS issues: |
You're right, if typechecking is limited to the editor then we'd be losing type safety versus compiling directly via intlc first and then running tsc. Might it be worth considering ttypescript given how pervasive translation imports are? |
The current Web workflow works pretty nicely with intlc able to compile everything in under a second, but it adds some extra moving parts separate from the main builds.
What we do right now is compile
*.translations.json
to*.ts
and import from the latter in TypeScript. What we could potentially do instead is import directly from*.translations.json
. The Webpack plugin would handle runtime compilation and the tsc plugin, a la typescript-plugin-toml, would handle the language server side of things. The pattern should ideally be configurable in both cases.The only question is whether the plugin infrastructure supports returning raw TypeScript code for tsc to check, which it'd obtain via a shell call to intlc. I haven't checked if the linked plugin is doing that or returning only computed type information. If the latter that might be doable but it'd be a good chunk more complex.
The text was updated successfully, but these errors were encountered: