nodejs / nodejs/cjs-module-lexer
Extending exports object detections
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 262
- Forks
- 31
- Avg merge
- 9d 2h
- Merged PRs (30d)
- 5
Description
Object expressons like:
module.exports = {
render: _render2['default'],
shallow: _shallow2['default'],
mount: _mount2['default'],
ShallowWrapper: _ShallowWrapper2['default'],
ReactWrapper: _ReactWrapper2['default'],
configure: _configuration.merge,
EnzymeAdapter: _EnzymeAdapter2['default']
};
would still be beneficial to fully support reading their properties.
The challenge is doing this without a full parser that can't handle eg object expression / brace ambiguity details.
One idea is that it could be possible to use a , parser with no knowledge of object assign / expression ambiguity but purely based on matching the first , that happens at the same depth of brace tracking (including all brace types) which might be a way to dodge the harder parsing issues while supporting arbitrary expressions.
Will leave this open as a tracking issue for that kind of support.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the object-expression examples and the proposed same-depth comma and brace-tracking approach. Done means named properties in these exports are fully supported without requiring a full parser, including arbitrary expressions and nested brace types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100