kentcdodds / kentcdodds/slice-js
Improve the core plugin
- Dominant language
- JavaScript
- Stars
- 17
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
There's definitely some code that the core plugin can't safely operate on yet. My ultimate measure of success is when we're able to generate a slice of the UMD builds of lodash, React, Angular 2, Ember, and jQuery. That would be sooooo awesome. But right now if you try you'll have two problems:
1. Perf is no good (see #3)
2. You get an error (probably that some node expected a property to be an Expression but was undefined).
Turns out that safely removing nodes is a really hard thing to do. You often end up removing too much. So we need to just keep trying more code of varying styles and adding them to the test suit.
Here's a great way to get started doing that:

Once you've gotten the plugin fixed up, just copy the source you're slicing to [fixtures](https://github.com/kentcdodds/slice-js/tree/1599643fd384c1699f5c82c834656c5ba54ad1c0/src/slice-code/test/fixtures) and add a `.test.js` file [here](https://github.com/kentcdodds/slice-js/tree/1599643fd384c1699f5c82c834656c5ba54ad1c0/src/slice-code/test) (see the other ones there for an idea of how to use the utils).
Contributor guide
Research direction
Start by reproducing the slicing error and performance issue described in the issue, then inspect the core plugin and the existing tests under src/slice-code/test. Add representative source files to src/slice-code/test/fixtures and matching .test.js files, following the existing test utilities. Done means the added cases slice safely without the reported undefined Expression error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100