benjamn / benjamn/ast-types

path-visitor implementation origin story

Open
#951 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
194
Avg merge
22h 43m
Merged PRs (30d)
10

Description

I'm trying to refactor path-visitor into something that might better meet my own needs for a particular situation.

I noticed that while ast-types is written in Typescript, the code in path-visitor.ts is written with lots of the Javscript prototype inheritance/manipulation that you'd often see people doing in Javascript prior to when Typescript got popular.

Would @benjamn, @brieb, or someone else know what the reason for implementing path-visitor.ts this way? This is not a criticism, I'm just trying to understand whether if I re-implemented path-visitor.ts in pure typescript whether I'd be leaving out some key implementation requirement I didn't think of.

Any light anyone could shed on this would be greatly appreciate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading path-visitor.ts and tracing its prototype-based implementation. The issue is resolved when the rationale for that design and any constraints on a pure TypeScript rewrite are documented or provided by a maintainer; no tests or other files are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.