Last active
August 31, 2020 08:55
-
-
Save thenamankumar/e7708b4bdc82a1e35817625aaf280f81 to your computer and use it in GitHub Desktop.
Revisions
-
thenamankumar revised this gist
Aug 31, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ **Organisation:** GraphQL Foundation ## Goal The goal of this project was to bring error recovery and streaming support in the graphql reference parser while maintaining the code readability, spec compliance and parser performance. This will enable this parser to be used by IDE like applications such as CodeMirror and GraphiQL. This project will also cover the migration of GraphiQL, GraphQL LSP server and CodeMirror Graphql to use the updated graphql reference parser. ## Project After the project planning, Ivan and me broken down the whole migration process of adding the new capabilities to the graphql-js reference parser into 3 phases. @@ -17,14 +17,14 @@ After the project planning, Ivan and me broken down the whole migration process - **Integrate** ### Explore & Measure This phase constitutes understanding the current implementation of graphiql parser and listing the requirements to integrate graphql-js parser with it. It also included increasing our confidence for doing changes by introducing tests. - [x] Writing tests for graphiql parser and achieving 100% code coverage https://github.com/graphql/graphiql/pull/1654 - [x] Adding benchmarks for graphiql parser and compare with the graphql-js parser https://github.com/graphql/graphiql/pull/1612 - [x] Testing the integration of Lexer from graphql-js into graphiql https://github.com/hereisnaman/graphiql/pull/4 ### Build Based on the learning from the previous phase, we decided to build a separate experimental parser inside graphql-js which supports the requirements for a state-full incremental parser which can be used by IDEs such as graphiql itself. This parser was a generic engine which takes grammar rules in json format and parses the source string based on it. It emits a single token in each iteration and updates the state object. - [x] Building an experimental parser inside graphql-js https://github.com/graphql/graphql-js/pull/2770 -
thenamankumar created this gist
Aug 30, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ # Adding streaming support and error recovery to reference GraphQL parser **GSOC 2020** **Student:** Naman Kumar **Mentor:** Ivan Goncharov **Organisation:** GraphQL Foundation ## Goal The goal of this project is to bring error recovery and streaming support in the graphql reference parser while maintaining the code readability, spec compliance and parser performance. This will enable this parser to be used by IDE like applications such as CodeMirror and GraphiQL. This project will also cover the migration of GraphiQL, GraphQL LSP server and CodeMirror Graphql to use the updated graphql reference parser. ## Project After the project planning, Ivan and me broken down the whole migration process of adding the new capabilities to the graphql-js reference parser into 3 phases. - **Explore & Measure** - **Build** - **Integrate** ### Explore & Measure This phase constitues understanding the current implementation of graphiql parser and listing the requirements to integrate graphql-js parser with it. It also included increase confidence for doing changes by introducing tests. - [x] Writing tests for graphiql parser and achieving 100% code coverage https://github.com/graphql/graphiql/pull/1654 - [x] Adding benchmarks for graphiql parser and compare with the graphql-js parser https://github.com/graphql/graphiql/pull/1612 - [x] Testing the integration of Lexer from graphql-js into graphiql https://github.com/hereisnaman/graphiql/pull/4 ### Build Based on the learning from the previous phase, we decided to build a separate experimental parser inside graphql-js which supports the requirements for a state-full incremental parser which can be used by IDEs such as graphiql itself. This parser was a generic engine which takes a grammar rules in json format and parser the source string based on it. It emits a single token in each iteration and updates the state object. - [x] Building an experimental parser inside graphql-js https://github.com/graphql/graphql-js/pull/2770 ### Integrate The final step was to integrate the newly build experimental graphql parser with the graphiql. The work is partially complete. - [x] Write a wrapper over experimental parser to support the API required by codemirror. https://github.com/graphql/graphiql/pull/1653 - [x] Support syntax highlighting with the new parser integration. https://github.com/graphql/graphiql/pull/1653 - [ ] Support auto suggestions with the new parser integration. ## Conclusion The first 2 phases are successfully completed with the final phase of integration partially left.