preboot / angular-webpack

A complete, yet simple, starter for Angular v2+ using webpack
MIT License
1.29k stars 557 forks source link

Set @types/lodash version explicitly avoid TS 2.1 errors #284

Closed mcescalante closed 7 years ago

mcescalante commented 7 years ago

Essentially, a patch level semver update in @types/lodash (14.14.51) introduced TS 2.1 features, but we are using TS 2.0.10 until support for TS 2.1 officially lands for Angular. We need to lock it at version 14.14.50 for TS 2.0.x to not get errors.

More discussion and reference here: https://github.com/preboot/angular2-webpack/issues/283#issuecomment-276456247

GaryB432 commented 7 years ago

i don't think we wanted the lodash types in the starter

mcescalante commented 7 years ago

@GaryB432 if you don't lock this version, many errors are thrown on a fresh clone. This is essentially a workaround until we see upstream activity. If the regression is fixed upstream, or once Angular 2.1.x support lands this will be removed. I will open a PR to remove it as soon as we can do that.

Foxandxss commented 7 years ago

Damn, I maintain more projects with lodash on it. But hearing what @mcescalante has to say, I kind of agree.

Uhmmm...

GaryB432 commented 7 years ago

I just meant that the starter did not contain a locked or unlocked version of the types before; no lodash at all, just the types needed for the starter. You must have used it in your fork. Let's see what @Foxandxss decides on adding lodash to his starter.

mcescalante commented 7 years ago

@GaryB432 even though @types/lodash wasn't explicitly listed in package.json, it was still being installed as a dependency of something in package.json (typedoc). So before I added this locked version, it was automatically installing a newer version (you may not have noticed) which breaks the project.

├─┬ typedoc@0.5.5 
│ ├── @types/fs-extra@0.0.33 
│ ├── @types/handlebars@4.0.31 
│ ├── @types/highlight.js@9.1.9 
│ ├── @types/lodash@4.14.52 
...
Foxandxss commented 7 years ago

Yes, we don't, but 2 issues in same week about the starter being broken because everyone seems to be using lodash, is too much.

If we install the types, only the types, not the package itself. That will prevent new users to have this error just again.