Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser, Tree class roadmap #18

Open
19 tasks
MajorLift opened this issue Feb 14, 2023 · 0 comments
Open
19 tasks

Parser, Tree class roadmap #18

MajorLift opened this issue Feb 14, 2023 · 0 comments

Comments

@MajorLift
Copy link

MajorLift commented Feb 14, 2023

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

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

E. Increase Babel type guard coverage

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant