Skip to content

Commit 8b0f49d

Browse files
Ismaestroiramos
authored andcommitted
feat(light version): remove polyfill and reduce bundle size
1 parent 2d0779e commit 8b0f49d

File tree

10 files changed

+19
-23
lines changed

10 files changed

+19
-23
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ npm run update | Update the project dependencies with ng update
8282
* Scroll to first invalid input in forms (directive)
8383
* Autocomplete enabled in forms
8484
* Modernizr (browser features detection)
85-
* Safari polyfill for date inputs (date-input-polyfill)
8685
* Google Tag Manager
8786
* Github pages deploy ready
8887
* Unit tests with Jasmine and Karma including code coverage

package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"angular-cli-ghpages": "0.5.3",
6464
"codelyzer": "4.4.3",
6565
"coveralls": "3.0.2",
66-
"date-input-polyfill": "2.14.0",
6766
"hammerjs": "2.0.8",
6867
"html2canvas": "1.0.0-alpha.12",
6968
"http-server": "0.11.1",
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Input, OnInit} from '@angular/core';
1+
import {Component, OnInit} from '@angular/core';
22
import * as moment_ from 'moment';
33

44
const moment = moment_;
@@ -9,14 +9,12 @@ const moment = moment_;
99
styles: []
1010
})
1111
export class NgxExampleLibraryComponent implements OnInit {
12-
13-
@Input() locale: string;
1412
date: string;
1513

1614
constructor() {
1715
}
1816

1917
ngOnInit() {
20-
this.date = moment().locale(this.locale).format('dddd, D MMMM, YYYY LT');
18+
this.date = moment().format('dddd, D MMMM, YYYY LT');
2119
}
2220
}

projects/ngx-example-library/src/lib/ngx-example-library.module.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ export function initialize(options: any) {
1515
}
1616

1717
@NgModule({
18-
imports: [],
19-
declarations: [NgxExampleLibraryComponent],
20-
exports: [NgxExampleLibraryComponent]
18+
imports: [
19+
],
20+
declarations: [
21+
NgxExampleLibraryComponent
22+
],
23+
exports: [
24+
NgxExampleLibraryComponent
25+
]
2126
})
2227
export class NgxExampleLibraryModule {
2328
static forRoot(options?: SampleModuleOptions): ModuleWithProviders {

projects/ngx-example-library/tsconfig.lib.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
"lib": [
1616
"dom",
1717
"es2015"
18-
]
18+
],
19+
"paths": {
20+
"moment": [
21+
"../../node_modules/moment/min/moment.min.js"
22+
]
23+
}
1924
},
2025
"angularCompilerOptions": {
2126
"annotateForClosureCompiler": true,

src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import {AppRoutingModule} from './app-routing.module';
33
import {CoreModule} from './core/core.module';
44
import {AppComponent} from './app.component';
55
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
6-
import {NgxExampleLibraryModule} from '@ismaestro/ngx-example-library';
76
import {ServiceWorkerModule} from '@angular/service-worker';
87
import {environment} from '../environments/environment';
98
import {WebpackTranslateLoader} from './webpack-translate-loader';
109
import {APP_CONFIG, AppConfig} from './configs/app.config';
1110
import {SharedModule} from './shared/shared.module';
11+
import {NgxExampleLibraryModule} from '@ismaestro/ngx-example-library';
1212

1313
@NgModule({
1414
imports: [

src/app/shared/components/footer/footer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<span>{{ 'angularExampleApp' | translate }} 2018</span>
66
</div>
77
<div fxFlex="33" class="text--center" *ngIf="currentLang">
8-
<lib-ngx-example-library [locale]="currentLang"></lib-ngx-example-library>
8+
<lib-ngx-example-library></lib-ngx-example-library>
99
</div>
1010
<div fxFlex class="text--right" class.xs="footer-xs">
1111
<a href="https://angular.io/" target="_blank"><img src="assets/images/angular.svg"></a>

src/app/shared/shared.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {NgModule} from '@angular/core';
22
import {MaterialModule} from './modules/material.module';
33
import {TranslateModule} from '@ngx-translate/core';
44
import {FlexLayoutModule} from '@angular/flex-layout';
5-
import {NgxExampleLibraryModule} from '@ismaestro/ngx-example-library';
65
import {CommonModule} from '@angular/common';
76
import {SpinnerComponent} from './components/spinner/spinner.component';
87
import {FooterComponent} from './components/footer/footer.component';
@@ -14,6 +13,7 @@ import {HomePageComponent} from './pages/home-page/home-page.component';
1413
import {Error404PageComponent} from './pages/error404-page/error404-page.component';
1514
import {HeroCardComponent} from './components/hero-card/hero-card.component';
1615
import {ScrollToFirstInvalidDirective} from './directives/scroll-to-first-invalid.directive';
16+
import {NgxExampleLibraryModule} from '@ismaestro/ngx-example-library';
1717

1818
@NgModule({
1919
imports: [

src/polyfills.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
6666
* APPLICATION IMPORTS
6767
*/
6868
import 'hammerjs';
69-
import 'date-input-polyfill';

0 commit comments

Comments
 (0)