diff --git a/.browserslistrc b/.browserslistrc index f2e748dcd6..4f9ac26980 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -8,29 +8,9 @@ # You can see what browsers were selected by your queries by running: # npx browserslist -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# For the full list of supported browsers by the Angular framework, please see: -# https://angular.io/guide/browser-support - -# You can see what browsers were selected by your queries by running: -# npx browserslist - last 1 Chrome version last 1 Firefox version last 2 Edge major versions last 2 Safari major versions last 2 iOS major versions Firefox ESR -not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line. -not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. - - -## previous PWA configuration: -# > 0.5% -# last 2 versions -# Firefox ESR -# not dead -# IE 11 diff --git a/.vscode/intershop.txt b/.vscode/intershop.txt index e8788a4806..cf078f3c75 100644 --- a/.vscode/intershop.txt +++ b/.vscode/intershop.txt @@ -186,6 +186,7 @@ unflatten setuprequest ruleset rulesets +unpatched foo foos diff --git a/docs/concepts/localization.md b/docs/concepts/localization.md index 945cc91977..97f16072ab 100644 --- a/docs/concepts/localization.md +++ b/docs/concepts/localization.md @@ -7,12 +7,14 @@ kb_sync_latest_only # Localization -Intershop Progressive Web App uses a mix of Angular's internationalization tools (i18n) and the internationalization library ngx-translate for localization. +Intershop Progressive Web App uses the internationalization library ngx-translate for localization. +In addition the dependency to Angular's internationalization tools (i18n) is needed as a dependency for ng-bootstrap. For more information refer to: -- [Angular - Internationalization (i18n)](https://angular.io/guide/i18n) - [NGX-Translate: The internationalization (i18n) library for Angular](http://www.ngx-translate.com/) +- [Angular - Internationalization (i18n)](https://angular.io/guide/i18n) +- [ng-bootstrap Angular 9 support](https://github.com/ng-bootstrap/ng-bootstrap/issues/3537#issuecomment-586472803) ## Usage Examples diff --git a/package-lock.json b/package-lock.json index 35327001a9..c37a05ebc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11651,11 +11651,6 @@ } } }, - "core-js": { - "version": "3.20.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.3.tgz", - "integrity": "sha512-vVl8j8ph6tRS3B8qir40H7yw7voy17xL0piAjlbBUsH7WIfzoedL/ZOr1OV9FyZQLWXsayOJyV4tnRyXR85/ag==" - }, "core-js-compat": { "version": "3.20.3", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.20.3.tgz", @@ -26557,11 +26552,6 @@ } } }, - "url-polyfill": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.12.tgz", - "integrity": "sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A==" - }, "user-home": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", diff --git a/package.json b/package.json index 84d4527ec2..d568c1bd6b 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,6 @@ "angular2-uuid": "^1.1.1", "angulartics2": "^12.0.0", "bootstrap": "^4.6.1", - "core-js": "^3.19.2", "express": "^4.17.2", "express-http-proxy": "^1.6.3", "express-robots-txt": "1.0.0", @@ -98,7 +97,6 @@ "tslib": "^2.3.1", "typeface-roboto": "1.1.13", "typeface-roboto-condensed": "1.1.13", - "url-polyfill": "^1.1.12", "xliff": "^6.0.0", "zone.js": "~0.11.4" }, diff --git a/src/polyfills.ts b/src/polyfills.ts index 11264b2814..15514d2dba 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -2,7 +2,7 @@ * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates. */ import '@angular/localize/init'; -// spell-checker: disable + /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. @@ -13,8 +13,8 @@ import '@angular/localize/init'; * file. * * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * 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 */ @@ -23,34 +23,6 @@ import '@angular/localize/init'; * BROWSER POLYFILLS */ -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -import 'core-js/es/symbol'; -import 'core-js/es/object'; -import 'core-js/es/function'; -import 'core-js/es/parse-int'; -import 'core-js/es/parse-float'; -import 'core-js/es/number'; -import 'core-js/es/math'; -import 'core-js/es/string'; -import 'core-js/es/date'; -import 'core-js/es/array'; -import 'core-js/es/regexp'; -import 'core-js/es/map'; -import 'core-js/es/weak-map'; -import 'core-js/es/set'; - -import 'url-polyfill/url-polyfill.js'; - -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - -/** - * Web Animations `@angular/platform-browser/animations` - * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. - * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). - */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - /** * By default, zone.js will patch all possible macroTask and DomEvents * user can disable parts of macroTask/DomEvents patch by setting following flags @@ -58,7 +30,7 @@ import 'url-polyfill/url-polyfill.js'; * 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.ts'; + * import './zone-flags'; * * The flags allowed in zone-flags.ts are listed here. * @@ -87,8 +59,7 @@ import 'zone.js'; // Included with Angular CLI. // MAGIC: https://stackoverflow.com/questions/50371593/angular-6-uncaught-referenceerror-buffer-is-not-defined (window as any).global = window; -global.Buffer = global.Buffer || require('buffer').Buffer; - +// version method for inspecting PWA version information (global as any).version = () => ({ displayVersion: JSON.parse(document.querySelector('#intershop-pwa-state')?.textContent?.replace(/&q;/g, '"') || '{}') .displayVersion, diff --git a/src/setupJest.ts b/src/setupJest.ts index 8141a30f59..8bfdac6b92 100644 --- a/src/setupJest.ts +++ b/src/setupJest.ts @@ -2,6 +2,7 @@ require('jest-preset-angular/setup-jest'); import { CompilerOptions } from '@angular/core'; import { getTestBed } from '@angular/core/testing'; +import '@angular/localize/init'; import * as matchers from 'jest-extended'; expect.extend(matchers);