diff --git a/ponyracer/angular.json b/ponyracer/angular.json index 6c77bca43..2929e7846 100644 --- a/ponyracer/angular.json +++ b/ponyracer/angular.json @@ -16,7 +16,9 @@ "outputPath": "dist/ponyracer", "index": "src/index.html", "main": "src/main.ts", - "polyfills": "src/polyfills.ts", + "polyfills": [ + "zone.js" + ], "tsConfig": "tsconfig.app.json", "assets": [ "src/favicon.ico", @@ -41,12 +43,6 @@ "maximumError": "4kb" } ], - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], "outputHashing": "all" }, "development": { @@ -81,8 +77,10 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", + "polyfills": [ + "zone.js", + "zone.js/testing" + ], "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "assets": [ diff --git a/ponyracer/package.json b/ponyracer/package.json index c42378a2c..599545274 100644 --- a/ponyracer/package.json +++ b/ponyracer/package.json @@ -23,8 +23,8 @@ "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "^15.0.0-next.2", - "@angular/cli": "~15.0.0-next.2", + "@angular-devkit/build-angular": "^15.0.0-next.3", + "@angular/cli": "~15.0.0-next.3", "@angular/compiler-cli": "^15.0.0-next.0", "@types/jasmine": "~4.3.0", "jasmine-core": "~4.4.0", diff --git a/ponyracer/src/environments/environment.prod.ts b/ponyracer/src/environments/environment.prod.ts deleted file mode 100644 index 3612073bc..000000000 --- a/ponyracer/src/environments/environment.prod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const environment = { - production: true -}; diff --git a/ponyracer/src/environments/environment.ts b/ponyracer/src/environments/environment.ts deleted file mode 100644 index f56ff4702..000000000 --- a/ponyracer/src/environments/environment.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file can be replaced during build by using the `fileReplacements` array. -// `ng build` replaces `environment.ts` with `environment.prod.ts`. -// The list of file replacements can be found in `angular.json`. - -export const environment = { - production: false -}; - -/* - * For easier debugging in development mode, you can import the following file - * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. - * - * This import should be commented out in production mode because it will have a negative impact - * on performance if an error is thrown. - */ -// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/ponyracer/src/main.ts b/ponyracer/src/main.ts index c7b673cf4..e296e796a 100644 --- a/ponyracer/src/main.ts +++ b/ponyracer/src/main.ts @@ -1,12 +1,9 @@ -import { enableProdMode } from '@angular/core'; + import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; -if (environment.production) { - enableProdMode(); -} platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); + diff --git a/ponyracer/src/polyfills.ts b/ponyracer/src/polyfills.ts deleted file mode 100644 index 429bb9ef2..000000000 --- a/ponyracer/src/polyfills.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes recent versions of Safari, Chrome (including - * Opera), Edge on the desktop, and iOS and Chrome on mobile. - * - * Learn more in https://angular.io/guide/browser-support - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** - * By default, zone.js will patch all possible macroTask and DomEvents - * user can disable parts of macroTask/DomEvents patch by setting following flags - * because those flags need to be set before `zone.js` being loaded, and webpack - * will put import in the top of bundle, so user need to create a separate file - * in this directory (for example: zone-flags.ts), and put the following flags - * into that file, and then add the following code before importing zone.js. - * import './zone-flags'; - * - * The flags allowed in zone-flags.ts are listed here. - * - * The following flags will work for all browsers. - * - * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame - * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick - * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames - * - * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js - * with the following flag, it will bypass `zone.js` patch for IE/Edge - * - * (window as any).__Zone_enable_cross_context_check = true; - * - */ - -/*************************************************************************************************** - * Zone JS is required by default for Angular itself. - */ -import 'zone.js'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ diff --git a/ponyracer/src/test.ts b/ponyracer/src/test.ts deleted file mode 100644 index cac5aa3ea..000000000 --- a/ponyracer/src/test.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: { - context(path: string, deep?: boolean, filter?: RegExp): { - (id: string): T; - keys(): string[]; - }; -}; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { - errorOnUnknownElements: true, - errorOnUnknownProperties: true -}); - -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().forEach(context); diff --git a/ponyracer/tsconfig.app.json b/ponyracer/tsconfig.app.json index 82d91dc4a..374cc9d29 100644 --- a/ponyracer/tsconfig.app.json +++ b/ponyracer/tsconfig.app.json @@ -6,8 +6,7 @@ "types": [] }, "files": [ - "src/main.ts", - "src/polyfills.ts" + "src/main.ts" ], "include": [ "src/**/*.d.ts" diff --git a/ponyracer/tsconfig.spec.json b/ponyracer/tsconfig.spec.json index 092345b02..be7e9da76 100644 --- a/ponyracer/tsconfig.spec.json +++ b/ponyracer/tsconfig.spec.json @@ -7,10 +7,6 @@ "jasmine" ] }, - "files": [ - "src/test.ts", - "src/polyfills.ts" - ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts"