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

Remove superfluous lodash usage #2938

Merged
merged 1 commit into from
Aug 10, 2017
Merged

Conversation

Timer
Copy link
Contributor

@Timer Timer commented Aug 10, 2017

No description provided.

const matched = /Unexpected token:(.+)\[(.+):(.+),(.+)\]\[.+\]/.exec(
stack
);
const matched = /(.+)\[(.+):(.+),(.+)\]\[.+\]/.exec(stack);
Copy link
Contributor Author

@Timer Timer Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other errors (e.g. unknown operator / invalid left hand assignment), so I went for the standard line format from this regex. Seems to work.

throw new Error(
"The regex pattern is not matched. Maybe UglifyJs changed it's message?"
);
throw new Error('Using errors for control flow is bad.');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😺

Copy link
Contributor Author

@Timer Timer Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm short on time, but anyone who sees this can feel free to submit a PR removing the usage of this error for control flow.

}
const problemPath = matched[2];
const line = matched[3];
const column = matched[4];
console.log(
'Failed to minify the code from this file: \n\n',
chalk.yellow(`${problemPath} line ${line}:${column}`),
chalk.yellow(
`\t${problemPath}:${line}${column !== '0' ? ':' + column : ''}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well hide the column if it's not useful.

@Timer Timer merged commit 93029f8 into facebook:master Aug 10, 2017
@Timer Timer deleted the superfluous-lodash branch August 10, 2017 23:18
@Timer
Copy link
Contributor Author

Timer commented Aug 10, 2017

Released in react-dev-utils v3.1.1.

@gaearon gaearon mentioned this pull request Aug 28, 2017
matart15 pushed a commit to matart15/create-react-app that referenced this pull request Aug 29, 2017
…react-app

* 'master' of https://github.com/facebookincubator/create-react-app: (36 commits)
  Publish
  Changelog for 1.0.12 (facebook#3016)
  Relax React dep requirements
  Default Favicon lossless optimisation (facebook#2917)
  update babel-runtime dependency in react-error-overlay and react-scripts (facebook#2991)
  Convert react-error-overlay to React (facebook#2515)
  Bump react-dev-utils
  Fix module function name in error overlay (facebook#3012)
  Docs: debugging in WebStorm (facebook#2986)
  Fix docs for `printFileSizesAfterBuild` (facebook#2942)
  Remove Modulus from user guide (facebook#2948)
  Remove superfluous lodash usage (facebook#2938)
  Update README.md (facebook#2927)
  Publish
  Prepare for 1.0.11 release (facebook#2924)
  Update dev deps (facebook#2923)
  Update README.md
  Use env variable to disable source maps (facebook#2818)
  Make formatWebpackMessages return all messages (facebook#2834)
  Adjust the `checkIfOnline` check if in a corporate proxy environment (facebook#2884)
  ...
gaearon added a commit that referenced this pull request Sep 2, 2017
## 1.0.13 (September 2, 2017)

#### 🐛 Bug Fix

* `react-error-overlay`

  * [#3051](#3051) Fix case-sensitivity issue with upgrading the package version. ([@tharakawj](https://github.com/tharakawj))

* `react-dev-utils`

  * [#3049](#3049) Print filesize difference for chunks. ([@esturcke](https://github.com/esturcke))

* `react-scripts`

  * [#3046](#3046) Fix crash in development mode on IE11. ([@tharakawj](https://github.com/tharakawj))

#### 💅 Enhancement

* `react-scripts`

  * [#3033](#3033) Add an empty mock for `child_process` to let some libraries compile. ([@McFlurriez](https://github.com/McFlurriez))

#### 🏠 Internal

* `react-dev-utils`, `react-error-overlay`

  * [#3028](#3028) Make error overlay filename configurable. ([@jaredpalmer](https://github.com/jaredpalmer))

#### Committers: 4

- Anthony ([McFlurriez](https://github.com/McFlurriez))
- Erik J. Sturcke ([esturcke](https://github.com/esturcke))
- Jared Palmer ([jaredpalmer](https://github.com/jaredpalmer))
- Tharaka Wijebandara ([tharakawj](https://github.com/tharakawj))

### Migrating from 1.0.12 to 1.0.13

Inside any created project that has not been ejected, run:

```
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

## 1.0.12 (August 28, 2017)

#### 🐛 Bug Fix

* `react-error-overlay`
  * [#3012](#3012) Fix module function name in error overlay. ([@gaearon](https://github.com/gaearon))

* `react-dev-utils`
  * [#2938](#2938) Remove superfluous lodash usage. ([@Timer](https://github.com/Timer))

#### 💅 Enhancement

* `react-scripts`

  * [#2917](#2917) Optimize the size of default favicon. ([@sylvainbaronnet](https://github.com/sylvainbaronnet))

#### 📝 Documentation

* `react-scripts`

  * [#2986](#2986) Docs: debugging in WebStorm. ([@prigara](https://github.com/prigara))
  * [#2948](#2948) Remove Modulus from user guide. ([@Zertz](https://github.com/Zertz))
  * [#2927](#2927) Update README.md. ([@tbassetto](https://github.com/tbassetto))

* `react-dev-utils`

  * [#2942](#2942) Fix docs for `printFileSizesAfterBuild`. ([@Kerumen](https://github.com/Kerumen))

#### 🏠 Internal

* `react-error-overlay`, `react-scripts`

  * [#2991](#2991) Update `babel-runtime` dependency ([@christophehurpeau](https://github.com/christophehurpeau))

* `react-dev-utils`, `react-error-overlay`, `react-scripts`

  * [#2515](#2515) Convert `react-error-overlay` to React ([@tharakawj](https://github.com/tharakawj))

#### Committers: 9

- Christophe Hurpeau ([christophehurpeau](https://github.com/christophehurpeau))
- Dan Abramov ([gaearon](https://github.com/gaearon))
- Ekaterina Prigara ([prigara](https://github.com/prigara))
- Joe Haddad ([Timer](https://github.com/Timer))
- Pier-Luc Gendreau ([Zertz](https://github.com/Zertz))
- Sylvain Baronnet ([sylvainbaronnet](https://github.com/sylvainbaronnet))
- Tharaka Wijebandara ([tharakawj](https://github.com/tharakawj))
- Thomas Bassetto ([tbassetto](https://github.com/tbassetto))
- Yann Pringault ([Kerumen](https://github.com/Kerumen))

### Migrating from 1.0.11 to 1.0.12

Inside any created project that has not been ejected, run:

```
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

**Note:** there’s a [known issue](#3041) that might cause the project to not compile after upgrading. In this case, migrate straight to `1.0.13` which doesn’t have this issue.
JohnNilsson referenced this pull request in JohnNilsson/create-react-app-typescript Sep 9, 2017
kasperpeulen pushed a commit to kasperpeulen/create-react-app that referenced this pull request Sep 24, 2017
swengorschewski referenced this pull request in swengorschewski/cra-typescript-electron Oct 16, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants