Rewrite `import` statements
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
At the very least, raw imports can be done easily:
```js
import foo from 'bar';
//=> var foo = require('bar');
```
Handling multiple and/or partial imports will be more problematic:
```js
import { foo, bar } from 'baz';
//=> var foo = require('baz').foo;
//=> var bar = require('baz').bar;
```
Handling aliases is the next step:
```js
import * as foo from 'bar';
//=> var foo = require('bar');
import { foo as bar } from 'baz';
//=> var bar = require('baz').bar;
```
### Concerns
* Handling `default` exports (╯°□°)╯
---
#### References
#4, https://github.com/flyjs/fly/issues/239, https://github.com/flyjs/fly/issues/159#issuecomment-208233654
Contributor guide
No contributing guide indexed for this repository
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 by reviewing the import examples in this issue, then read referenced issues #4, Fly #239, and Fly #159. Define the supported raw, partial, aliased, and default-import cases, and verify that the rewrite handles each documented form consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100