angular-realworld-example-app icon indicating copy to clipboard operation
angular-realworld-example-app copied to clipboard

Feat(Global): upgrade Angular8

Open hamzahamidi opened this issue 5 years ago • 8 comments

  • Feat(Global): upgrade to angular8
  • Feat(CI): upgrade to NodeJs 10.15.0 (LTS)

hamzahamidi avatar Jun 22 '19 22:06 hamzahamidi

EDIT: Using signed commits

hamzahamidi avatar Jun 23 '19 16:06 hamzahamidi

@owenmecham @juristr can you please check this PR?

hamzahamidi avatar Jun 26 '19 16:06 hamzahamidi

Hey, sorry but won't make it this week. Too much scheduled already. @joeeames can u review it?

juristr avatar Jun 26 '19 18:06 juristr

Can we also upgrade quide old content of the angular-realworld-example-app/src/test.ts to current test template?

// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

If there would be tests, it would work OK. Thanks!

peterblazejewicz avatar Jul 10 '19 21:07 peterblazejewicz

Also, could the main.ts - as part of upgrade, be aligned with default template?

diff --git a/src/main.ts b/src/main.ts
index dd072d0..ba6abde 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -8,8 +8,6 @@ if (environment.production) {
   enableProdMode();
 }
 
-const bootstrapPromise =  platformBrowserDynamic().bootstrapModule(AppModule);
-
-// Logging bootstrap information
-bootstrapPromise.then(success => console.log(`Bootstrap success`))
+platformBrowserDynamic().bootstrapModule(AppModule)
+  .then(success => console.log(`Bootstrap success`))
   .catch(err => console.error(err));

peterblazejewicz avatar Jul 10 '19 21:07 peterblazejewicz

LGTM :shipit:

peterblazejewicz avatar Jul 10 '19 21:07 peterblazejewicz

Also, could the main.ts - as part of upgrade, be aligned with default template?

diff --git a/src/main.ts b/src/main.ts
index dd072d0..ba6abde 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -8,8 +8,6 @@ if (environment.production) {
   enableProdMode();
 }
 
-const bootstrapPromise =  platformBrowserDynamic().bootstrapModule(AppModule);
-
-// Logging bootstrap information
-bootstrapPromise.then(success => console.log(`Bootstrap success`))
+platformBrowserDynamic().bootstrapModule(AppModule)
+  .then(success => console.log(`Bootstrap success`))
   .catch(err => console.error(err));

That's pretty much the same we actually have. I do prefer the old one because we actually create a promise variable called bootstrapPromise & consequently gives more sense.

hamzahamidi avatar Jul 10 '19 21:07 hamzahamidi

PS: this is also implemented in https://github.com/gothinkster/angular-realworld-example-app/pull/145

khaledosman avatar Jul 23 '19 12:07 khaledosman

Triaging pull requests after some years of no maintainers on this project. Closing this one as the project has been updated to Angular v11 meanwhile.

geromegrignon avatar Mar 16 '23 16:03 geromegrignon