Open kriskowal opened 9 years ago
I actually have a branch that postinstall builds the parser. I'll put up a pr soon but really this shouldn't be an issue. If projects pre-parse their thrift files and dump the AST, and assuming we can opt out of building the parser (i.e. stop eagerly building it on require) then there is no need to run this pre-processor step in production services.
Let’s make a PR that conditionally builds the PEGJS parser. We can encourage services to build a JSON dump of the syntax tree and provide an interface that accepts the JSON AST in addition to the source text, bypassing the parse step. (The source is still needed for Meta::thriftIDL)
syntax
alongside source
(or syntaxes
alongside sources
for the imports feature eventually)
Parse Thrift IDL to an intermediate JSON representation to avoid re-parsing with PEGJS at startup time in services.
cc @Matt-Esch for raising the issue of startup times cc @Raynos for bringing to my attention cc @malandrew @jcorbin for go team thriftrw