forked from oslabs-beta/sapling
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
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
- Module not processed correctly if directory name in path contains "." oslabs-beta/sapling#108
- Support TypeScript path aliases
- Support for webpack alias #9
E. Increase Babel type guard coverage
-
.getJSXChildren(),.getJSXProps(),.checkForRedux()methods - Redux hooks support oslabs-beta/sapling#107
- Nested Import
CallExpressioninArrowFunctionExpressionbody.
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
Metadata
Metadata
Assignees
Labels
No labels