refactor: taurpc to use specta v2.0.0-rc.23#63
Conversation
|
I suspect this might be superseded by #58 which as well as upgrading the Specta version also refactors TauRPCs logic use Specta's new exporter API instead of the primitives. This allows supporting features such as multi-file exporting, branded types and more which I don't think would work with this PRs implementation. |
|
Oh apologies. I saw that PR dated in 2025 so didn't check the latest commits. Yes I put this onto draft because I wasn't really happy with the implementation as it was not using the Specta api correctly, and wanted to use it as just 23 baseline until a later refactoring. But if you're working on your own version then please go ahead, I will close this pr and use it temporarily in my own project as it does work. Out of curiosity - what did you decide regarding the linter? I know specta disabled it but at least in my case that kind of feature is super useful because I want to avoid polluting git history because of some unexpected format changes in the bindings file. |
I personally found that having an official integration wasn't very good because for an sufficiently advanced JS monorepo I would end up having to build my own formatter hook anyway as the default just wasn't quite right. By the time your building your own integration it's better for Specta to just not get involved and not risk breaking changes in the API surface. My recommendation is to just use |
|
Ok thanks for the explanation. I will think about it more. I'm glad we agree that it makes more sense for this library as opposed to Specta due to higher specialization. |
Specta is preparing for 2.0.0 release and just released breaking api changes with v2.0.0-rc.23. The full changes can be found here.
I will use it in my own project for now as the changes are vast
Here's a breakdown of the changes:
collectfeature flag (renamed fromexport)functionfeature from specta-typescript (no longer exists)FunctionResultVariantwithFunctionReturnTypets::datatype()withts::primitives::inline()andts::primitives::reference()for correct type renderingtype_map.remove()call for Channel (method no longer exists in TypeCollection)framework_headersplitting logic and.format()call (both removed from specta-typescript).formatter(specta_typescript::formatter::prettier)comment (formatter integration removed in rc.23)What is left: