Carve out parser as a separate artifact - #947
Conversation
| ) | ||
| .jsSettings(scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))) | ||
| .nativeSettings(nativeSettings) | ||
| .nativeSettings(tlVersionIntroduced := Map("2.13" -> "0.31.0", "3" -> "0.31.0")) |
There was a problem hiding this comment.
Isn't this already defined in the cross-platform settings?
There was a problem hiding this comment.
It is — thanks. The extra line was only there to undo nativeSettings, which sets
tlVersionIntroduced to 0.26.1 (when Native moved to 0.5); that's wrong for a module
that's new in 0.31.0 on every platform. Simpler not to apply nativeSettings here at
all, so both lines are gone and Native picks up 0.31.0 from the cross-platform settings.
There was a problem hiding this comment.
Actually, I think tlVersionIntroduced shouldn't be necessary anymore at all.
that's wrong for a module that's new in 0.31.0 on every platform
Indeed, but it won't be checking for bincompat for any previous version anyway.
|
I think these should probably also be moved:
|
I looked at each of these, and I don't think any of them can move without taking most
Together that's ~3,800 lines, i.e. everything except the compiler, mapping, interpreter The current boundary is "GraphQL text in, |
3993287 to
0efa020
Compare
I think that's right, and I think this is a better partitioning. I don't doubt that you have uses for "text in, ast out", but I think it will be far more common to also need the semantics, and ability to check and normalize queries. |
The use case that motivates this cut is client query validation in If we do want to extract the full functionality involving semantics and schema validation, I'd push for a 3rd module. Also, this is a refactor that implies splitting files, not just moving them. For example, EDIT: We don't even need an AST in clue, a lexer will do. That would make the module even more stable. But there's no such thing in grackle. |
The AST can only tell you that a query is syntactically valid. You need the schema to know if it will actually be accepted by the server. |
This allows us to use the parser in clue for client-side validation of queries.