Skip to content

Commit

Permalink
feat: upgrade to Angular 12
Browse files Browse the repository at this point in the history
In case anyone is wondering about the new syntax for the webworker I found something here: parcel-bundler/parcel#5430
  • Loading branch information
maxime1992 committed Jan 19, 2022
1 parent d676559 commit 8349e35
Show file tree
Hide file tree
Showing 8 changed files with 1,798 additions and 2,303 deletions.
12 changes: 9 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": [],
"webWorkerTsConfig": "tsconfig.worker.json"
"webWorkerTsConfig": "tsconfig.worker.json",
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand Down Expand Up @@ -56,7 +61,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"------------------ DEMO COMMANDS -----------------": "",
"demo:start": "yarn run ng serve",
"demo:build:base": "yarn run ng build",
"demo:build:prod": "yarn run demo:build:base --prod",
"demo:build:prod": "yarn run demo:build:base --configuration=production",
"demo:test": "yarn run ng test",
"demo:lint:check": "yarn run ng lint",
"demo:lint:fix": "yarn run demo:lint:check --fix",
"------------------ LIB COMMANDS -----------------": "",
"lib:build:prod": "yarn run ng build --project wireframe-svg --prod",
"lib:build:prod": "yarn run ng build --project wireframe-svg --configuration=production",
"lib:build:watch": "yarn run lib:build:prod --watch",
"lib:test:watch": "yarn run ng test --project wireframe-svg",
"lib:test:ci": "yarn run ng test --project wireframe-svg --watch false",
Expand All @@ -29,27 +29,27 @@
"start": "yarn demo:start"
},
"dependencies": {
"@angular/animations": "~11.2.14",
"@angular/common": "~11.2.14",
"@angular/compiler": "~11.2.14",
"@angular/core": "~11.2.14",
"@angular/forms": "~11.2.14",
"@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "~11.2.14",
"@angular/router": "~11.2.14",
"@angular/animations": "~12.2.15",
"@angular/common": "~12.2.15",
"@angular/compiler": "~12.2.15",
"@angular/core": "~12.2.15",
"@angular/forms": "~12.2.15",
"@angular/platform-browser": "~12.2.15",
"@angular/platform-browser-dynamic": "~12.2.15",
"@angular/router": "~12.2.15",
"@babylonjs/core": "^4.1.0",
"core-js": "3.6.4",
"mesh-to-svg": "2.1.6",
"observable-webworker": "^3.2.3",
"rxjs": "~6.5.4",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.18",
"@angular/cli": "~11.2.18",
"@angular/compiler-cli": "~11.2.14",
"@angular/language-service": "~11.2.14",
"@angular-devkit/build-angular": "~12.2.15",
"@angular/cli": "~12.2.15",
"@angular/compiler-cli": "~12.2.15",
"@angular/language-service": "~12.2.15",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
Expand All @@ -61,15 +61,15 @@
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^11.2.4",
"ng-packagr": "^12.2.6",
"prettier": "^1.19.1",
"semantic-release": "^17.0.4",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.8"
"typescript": "~4.3.5"
},
"repository": {
"type": "git",
"url": "https://github.com/zakhenry/svg-from-wireframe.git"
}
}
}
4 changes: 2 additions & 2 deletions projects/wireframe-svg/src/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

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

Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class AppComponent implements AfterViewInit {
public workerOutput$: Observable<string> = this.workerInput$.pipe(
exhaustMap(input => {
return fromWorker<MeshToSvgWorkerPayload, string>(
() => new Worker('./mesh-to-svg.worker', { type: 'module' }),
() => new Worker(new URL('./mesh-to-svg.worker', import.meta.url), { type: 'module' }),
of(input),
i => [
i.mesh.positions.buffer,
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const environment = {
* 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/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
2 changes: 1 addition & 1 deletion src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
2 changes: 1 addition & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

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

Expand Down
Loading

0 comments on commit 8349e35

Please sign in to comment.