Closed
Description
I want to improve AST manipulation options in 1.9, including some breaking changes:
- Immutable AST nodes (breaking change)
- replace attr_accessor -> attr_reader (Make language nodes immutable #1338)
- freeze
.children
,.directives
and other attached arrays (bc940ba)
AddI decided against this because it doesn't support efficient modification, see Try to add path to AST nodes #1790Node#path
andNode#parent
Since the nodes are immutable, we can cache these on the nodes themselves[ ]Node#parent
references the node whereself
is a member ofchildren
[ ]Node#path
is the static path to this node in the query string (see ...TypeStack
, I think, where this is currently implemented)[ ] consider removingparent
from method-based visitor?
- Improve
Language::Visitor
- Build a method-based hook API ([Language::Visitor] use method-based visit handlers #1290)
- Add manipulation options like GraphQL-JS (Manipulate AST with visitor #1740)
- Deprecate
.enter <<
usage (Add warning for proc-based visitors #2017)
Also, fix some things that this will break:
- (fixed) GraphQL::Client will be broken
- (logged) Make sure GraphQL::Libgraphqlparser will still work
- Other broken things to fix?