Skip to content

chore: upgrade angular version to rc6 #1937

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

Merged
merged 1 commit into from
Sep 4, 2016
Merged

Conversation

Brocco
Copy link
Contributor

@Brocco Brocco commented Sep 1, 2016

No description provided.

@@ -15,7 +15,6 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
},
plugins: [
new WebpackMd5Hash(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(<any>{
mangle: { screw_ie8 : true, keep_fnames: true },

Choose a reason for hiding this comment

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

There was discussion in the core Angular project about a fix there that would remove the need for "keep_fnames: true" - I assume from this unchanged here, that such a fix did not make it in to RC6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not aware of that discussion, I was just taking a crack at updating. There's still an issue with e2e tests, but I wanted to get something pushed up for others to review.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah @Brocco we can remove that prop now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @TheLarkInn I'll strip that out and re-push, but I don't expect e2e to work based upon that change

@intellix
Copy link
Contributor

intellix commented Sep 1, 2016

With this and a newly generated project, when I serve I'm getting:

~/@angular/compiler/src/config.js: 15 - Uncaught TypeError: Cannot read property 'Emulated' of undefined

That line without sourcemaps contains: __WEBPACK_IMPORTED_MODULE_0__angular_core__["a" /* ViewEncapsulation */].Emulated

a - undefined
b - {0: "OnPush", 1: "Default", OnPush: 0, Default: 1}

webpack: 2.1.0-beta.21

Edit: I see that webpack was changed from ^2.0.0 to 2.0.0 which may fix it
Edit 2: I actually meant TypeScript and not webpack :)

@antonyRoberts
Copy link

Tried reverting to [email protected] and originally with 2.1.0-beta.21 and it errors out with
config.js:15 Uncaught TypeError: Cannot read property 'Emulated' of undefined

@TheLarkInn
Copy link
Member

Whoa whoa not Webpack 2.0, TS 2.0.0. webpack version is 100% correct

@antonyRoberts
Copy link

@TheLarkInn Thanks that makes a lot more sense than reverting Webpack. alas, I'd already reverted to TS 2.0.0 and it is still Uncaught TypeError: Cannot read property 'Emulated' of undefined,

@bjorkblom
Copy link

I got the same error, compile error on TypeScript "^2.0.0". After downgrade TypeScript to "2.0.0" the application compiles but get the Uncaught TypeError: Cannot read property 'Emulated' of undefined is shown when loading app.

@JiriBalcar
Copy link

JiriBalcar commented Sep 2, 2016

Hello, I think, that in addon/ng2/blueprints/ng2/files/package.json should be changed typescript version to 2.0.2 because the angular rc6 depends on new Type<T>.

Tried that on my clone of this repo and ng serve works without any errors.

Edit1: also in /package.json should be changed the typescript version to 2.0.2
Edit2: @Brocco Should I create new pull request? Or you will append to this one?

@celliott181
Copy link
Contributor

celliott181 commented Sep 2, 2016

@JiriBalcar We can't require TS 2.0.2 until #1901 and #1917 are dealt with. If you're getting it to work with a 2.0.2 dependency I'd check to see what tsc is being called because it's probably not the one you think you are.

@ValeryVS
Copy link
Contributor

ValeryVS commented Sep 3, 2016

@gelliott181 #1917 was with angular rc5. #1901 probably the same.
All errors was in angular and rxjs files.
I think, typescript 2.0.2 can work with angular rc6.

@JiriBalcar
Copy link

@ValeryVS I thought the same but the errors also occurs with rc6. I think that it is because new UMD bundles. I think, that some changes in bundles loader will have to be made in angular-cli. But I do not know Webpack that well. Does anybody knows how to do that. In angular changelog is example for SystemJS.

@brandom
Copy link

brandom commented Sep 3, 2016

I was able to get rc6 working by downgrading webpack to 2.1.0-beta.19 with existing CLI webpack config

Edit: Using [email protected]

@clydin
Copy link
Member

clydin commented Sep 4, 2016

Instead of downgrading webpack, you should be able to add
mainFields: ['browser', 'main'],
to the resolve webpack config section here: https://github.com/angular/angular-cli/blob/master/addon/ng2/models/webpack-build-common.ts#L38

This commit webpack/webpack@dc50c03 found in 2.1.0-beta.20+ seems to be the issue. It is causing webpack to use the new es2015 bundles in rc6.

@Brocco Brocco deleted the rc6-update branch September 4, 2016 13:39
@TheLarkInn
Copy link
Member

@clydin this doesn't make sense, RC6 is publishing es2015 bundles, shouldn't webpack be using them from the module field. I feel I'm missing something.

@Jessidhia
Copy link

Jessidhia commented Sep 5, 2016

If it works with the regular bundle but not the es2015 bundle, then something is either wrong with the bundle (missing __esModule: true annotation-property in the commonjs version?), or with how the exports are declared.

For example, export default { foo () {} }, if naively converted to commonjs as module.exports = { foo () {} }, can be imported (with the current babel/webpack behavior) as import { foo } from 'module', but with correct es2015 modules, it is not the case, as it is just a property in the value of the default export.

The modules spec appears to be moving in a direction that will forbid anything but importing default from commonjs modules, so even import { foo } from 'module' in the first example will break when eventually implementations catch up with the spec.

EDIT: I took a quick look into the UMD and ES6 modules builds of rc6. As the UMD build has no __esModule annotation in the exports, there definitely is a change in behavior between the handling of UMD and ES6 builds.

There doesn't seem to be anything wrong with the ES6 export itself, though; would have to look at the real output from webpack to see if it isn't doing anything funny like exports['a'] = {}, or hitting a corner case with multiple namespace reexports.

@keshavmesta
Copy link

I am guessing these changes weren't part of 1.0.0-beta.11-webpack.8 ??

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.