-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BREAKING] Enable Ivy distribution #90
[BREAKING] Enable Ivy distribution #90
Conversation
test/apps/angular-v11/angular.json
Outdated
@@ -17,6 +17,9 @@ | |||
"build": { | |||
"builder": "@angular-devkit/build-angular:browser", | |||
"options": { | |||
"allowedCommonJsDependencies": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix warnings like
Warning: @babel/runtime-corejs3/core-js/map depends on 'core-js-pure/features/map'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the work! Thank you for taking the time to do this POC.
It would be nice if this could be amended to notate that it's not actually a "fix," it merely instructs angular to not emit the warning. The optimization phase can still bail out if there's a conflict in the upstream dep, which will result in an unnecessarily fat build.
A fix would either be transpiling or rewriting the build with ecmascript modules. As a consumer I would appreciate the warning being present until such time as this is the case as it provides ready answer to the inevitable "why is my output so large?" question when the build triggers budget warnings.
re:
https://angular.io/guide/build#configuring-commonjs-dependencies
The Angular CLI outputs warnings if it detects that your browser application depends on CommonJS modules. To disable these warnings, add the CommonJS module name to allowedCommonJsDependencies option in the build options located in angular.json file.
CommonJs impact on optimization:
https://web.dev/commonjs-larger-bundles/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Current warnings:
Warning: /node_modules/@okta/okta-auth-js/esm/browser/AuthStateManager.js depends on 'p-cancelable'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: /node_modules/@okta/okta-auth-js/esm/browser/OktaAuth.js depends on 'tiny-emitter'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: /node_modules/@okta/okta-auth-js/esm/browser/fetch/fetchRequest.js depends on 'cross-fetch'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: /node_modules/unload/dist/es/index.js depends on 'detect-node'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
@@ -24,7 +24,7 @@ | |||
"typeRoots": [ | |||
"node_modules/@types/" | |||
], | |||
"types": ["node", "webappsec-credential-management"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed if building on Angular 12
src/okta-angular.ts
Outdated
@@ -14,6 +14,7 @@ export { OktaAuthModule } from './okta/okta.module'; | |||
export { OktaAuthGuard } from './okta/okta.guard'; | |||
export { OktaConfig, OKTA_CONFIG, OKTA_AUTH } from './okta/models/okta.config'; | |||
export { OktaAuthStateService } from './okta/services/auth-state.service'; | |||
export { OktaHasAnyGroupDirective } from './okta/has-any-group.directive'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix build on Angular 12:
src/okta/has-any-group.directive.ts:5:14 - error NG3001: Unsupported private class OktaHasAnyGroupDirective. This class is visible to consumers via OktaAuthModule -> OktaHasAnyGroupDirective, but is not exported from the top-level library entrypoint.
5 export class OktaHasAnyGroupDirective {
455a5e4
to
8627ee9
Compare
f0163a9
to
9a8c284
Compare
9a8c284
to
262649c
Compare
cd48f7d
to
9f78f94
Compare
5d164f0
to
dec2bd1
Compare
Issue: #86
Internal ref: OKTA-530587