react-component-tree icon indicating copy to clipboard operation
react-component-tree copied to clipboard

Parser, Tree class roadmap

Open MajorLift opened this issue 2 years ago • 0 comments

1. Parser

A. Expand Import Statement support

a) Static Imports

  • [ ] For static import statements with namespace or default specifiers, only add members that are used in the document.
import foo from "mod.js"
import * as foo from "mod.js"
  • [ ] Module imports for side effects only
import '/modules/my-module.js';
import 'http:example.com\pears.js';

b) Require Statements

  • [ ] Support namespaces and member expressions
const foo = require("./module"); ... ; <foo.component />;
  • [ ] Support invocations and method/member calls
const foo = require("./module")();
const foo = require("./module").method(arg);

c) Dynamic imports

  • [ ] Support AwaitExpression
const foo = await import("./module")
  • [ ] Support Promise.resolve()
const foo = Promise.resolve(import("./module"))
  • [ ] Support .then() chains
import("./module").then(mod => mod.loadPage())
  • [ ] Support non-literal specifiers in module name
import(`/modules/module-${index}.js`)

B. Implement Export Statement parser

  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#syntax

C. Support Barrel files

  • [ ] 1) Recognize barrel files
  • [ ] 2) Parse export statements in barrel file
  • [ ] 3) Parse export statements for components in each barrel file entry.

D. Support more path types

  • [ ] https://github.com/oslabs-beta/sapling/issues/108
  • [ ] Support TypeScript path aliases
  • [ ] #9

E. Increase Babel type guard coverage

  • [ ] .getJSXChildren(), .getJSXProps(), .checkForRedux() methods
  • [ ] https://github.com/oslabs-beta/sapling/issues/107
  • [ ] Nested Import CallExpression in ArrowFunctionExpression body.
const foo = React.lazy(() => import('./module'));

2. Tree

  • [ ] Consolidate Tree and Node data class/interfaces for parser, serialized workspace cache, and webview.
  • [ ] Encapsulation for class members

MajorLift avatar Feb 14 '23 06:02 MajorLift