Skip to content

Commit

Permalink
Merge pull request #275 from bkd-mba-fbi/feature/273-remove-ie11-support
Browse files Browse the repository at this point in the history
remove specialities for ie11 support
  • Loading branch information
spahrson authored Apr 15, 2021
2 parents fbcedd4 + d234377 commit d97bdda
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# https://github.com/browserslist/browserslist#queries

defaults
IE 11
not IE 11
17 changes: 4 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@
"maximumWarning": "6kb"
}
]
},
"es5": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"tsConfig": "src/tsconfig-es5.app.json"
}
}
},
Expand All @@ -90,9 +81,6 @@
"configurations": {
"production": {
"browserTarget": "absenzenmanagement:build:production"
},
"es5": {
"browserTarget": "absenzenmanagement:build:es5"
}
}
},
Expand Down Expand Up @@ -150,5 +138,8 @@
}
}
},
"defaultProject": "absenzenmanagement"
"defaultProject": "absenzenmanagement",
"cli": {
"analytics": false
}
}
43 changes: 1 addition & 42 deletions doc/browser-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,7 @@

[back](../README.md)

We support the evergreen browsers (Chrome, Firefox, Safari, Edge) and
IE 11.

## JavaScript

The Angular CLI generates a modern build (ES2015) and a legacy build
(ES5) and the browsers will get either one of those two build via
differential loading.

Note that you have to use the `start:es5` task when testing with IE11.

## CSS

To be compatible with IE 11, we use the
[autoprefixer](https://github.com/postcss/autoprefixer), which is part
of the default Angular CLI setup (see `browserlist` file for the
configuration).

There is also an `.ie11` class, that is present on the `<erz-app>`
node in IE 11 browsers. You can use this in your component styles to
implement IE 11 customizations:

```
:host-context(:not(.ie11)) .my-element {
// CSS for evergreen browsers
}
:host-context(.ie11) .my-element {
// CSS for IE 11
}
```

### CSS Grid

When using CSS Grid, add the following comment at the top of the .scss file to enable the autoprefixer's polyfills:

```
/* autoprefixer grid: on */
```

Checkout the following table for the supported features: https://css-tricks.com/css-grid-in-ie-css-grid-and-the-new-autoprefixer/#article-header-id-1
We support the evergreen browsers (Chrome, Firefox, Safari, Edge).

## Testing with BrowserStack

Expand All @@ -52,7 +12,6 @@ When testing browser compatiblity with [BrowserStack](https://www.browserstack.c
| --------- | --------------------- | ---------------------------- | -------------------------- |
| Windows | Chrome, Firefox, Edge | `npm start` | `http://localhost:4200` |
| Android | Chrome | `npm start` | `http://localhost:4200` |
| Windows | IE11 | `npm run start:es5` | `http://localhost:4200` |
| macOS/iOS | Safari | `npm run start:browserstack` | `http://bs-local.com:8000` |

With all browsers you must store a valid token in localStorage to be able to use the app.
2 changes: 0 additions & 2 deletions doc/setup-dev-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ This project was generated with [Angular CLI](https://github.com/angular/angular

Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

_Important note for IE 11 testing:_ the dev server has to be started with `npm run start:es5`, since `ng serve` [does not build the bundles for differential loading](https://github.com/angular/angular-cli/issues/14455) (it generates a single ES2015 build per default). Consider also: https://angular.io/guide/browser-support

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:es5": "ng serve --configuration es5",
"start:browserstack": "ng serve --host 0.0.0.0 --disable-host-check --port 8000",
"build": "ng build",
"build:prod": "ng build --prod",
Expand Down
4 changes: 0 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ import { NAVIGATOR } from './shared/tokens/dom-apis';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
@HostBinding('class.ie11') get isIE11(): boolean {
return /Trident.*rv:11\./.test(this.navigator.userAgent);
}

constructor(
i18n: I18nService,
private toastrService: ToastrService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "../../../../bootstrap-variables";

/* autoprefixer grid: on */

.entries-all {
padding: 0 0 (0.5 * $spacer) $spacer;
border-bottom: 1px solid $gray-200;
Expand All @@ -10,11 +8,6 @@
grid-template-columns: min-content 1fr min-content;
}

// IE11 workaround for `align-items: center`
.entries-all > * {
align-self: center;
}

.entry {
padding: $spacer;
border-bottom: 1px solid $gray-200;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "../../../../bootstrap-variables";

/* autoprefixer grid: on */

.content {
padding-left: $spacer;
padding-right: $spacer;
Expand Down Expand Up @@ -32,11 +30,6 @@
grid-template-columns: min-content 1fr;
}

// IE11 workaround for `align-items: center`
.absence-all > * {
align-self: center;
}

.absence-entry {
padding: $spacer;
border-bottom: 1px solid $gray-200;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "../../../../bootstrap-variables";

/* autoprefixer grid: on */

.content {
padding-left: $spacer;
padding-right: $spacer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "../../../../bootstrap-variables";

/* autoprefixer grid: on */

:host {
padding: 2 * $spacer $spacer;
background-color: $body-bg;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "../../../../bootstrap-variables";

/* autoprefixer grid: on */

:host {
display: flex;
flex-direction: column;
Expand All @@ -17,11 +15,6 @@
". date time dropdown-caret"
". description description dropdown-caret";
grid-template-columns: 1fr auto auto 1fr;

// I11 workaround for `align-items: center;`
> * {
align-self: center;
}
}

.lesson-date {
Expand All @@ -30,7 +23,7 @@

display: flex;
align-items: center;
justify-content: flex-end; // Use `flex-end` for IE 11 instead of `end`
justify-content: end;

button {
padding: 0 0.5ch 0 0;
Expand All @@ -48,11 +41,6 @@
border: none;
width: 11ch;
}
:host-context(.ie11) .lesson-date-input {
// Compensate for IE 11's crappy center alignment
margin-top: -5px;
width: 12ch;
}

.lesson-time {
grid-area: time;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "../../../../bootstrap-variables";

/* autoprefixer grid: on */

.absence-all {
padding: 0 0 (0.5 * $spacer) $spacer;
border-bottom: 1px solid $gray-200;
Expand All @@ -12,11 +10,6 @@
grid-template-columns: min-content 1fr min-content;
}

// IE11 workaround for `align-items: center`
.absence-all > * {
align-self: center;
}

.absence-entry {
padding: $spacer;
border-bottom: 1px solid $gray-200;
Expand Down
5 changes: 0 additions & 5 deletions src/app/shared/components/typeahead/typeahead.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@
.spinner-border {
color: $gray-600;
}

// Avoid overlapping with cross-icon that is displayed in IE 11
:host-context(.ie11) .spinner-container {
right: 2.25 * $spacer;
}
13 changes: 1 addition & 12 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,10 @@ import '@angular/localize/init';
*
*/

/**
* Polyfills for IE 11
*/
import 'core-js/es/array';
import 'core-js/es/string';
import 'core-js/es/object';

/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
// import 'zone.js/dist/zone'; // Included with Angular CLI.

// Workaround for IE 11, see https://github.com/angular/angular/issues/38561
// (use above import once fixed or irrelevant)
import 'zone.js/bundles/zone.umd';
import 'zone.js/dist/zone'; // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
6 changes: 0 additions & 6 deletions src/tsconfig-es5.app.json

This file was deleted.

0 comments on commit d97bdda

Please sign in to comment.