Skip to content
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

Disables ivy as it breaks libraries with ViewEngine compiler #156

Merged
merged 3 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions projects/ngx-cookie-service/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ngx-cookie-service",
"description": "an (aot ready) angular (4.2+) cookie service",
"version": "12.0.2",
"description": "An (aot ready) angular (4.2+) cookie service",
"version": "12.0.3",
"license": "MIT",
"author": "Stepan Suvorov <stevermeister@gmail.com>",
"keywords": [
Expand Down Expand Up @@ -32,6 +32,9 @@
"cookies"
],
"contributors": [
{
"name": "Pavan Kumar Jadda"
},
{
"name": "Christopher Parotat",
"email": "c.parotat@7leads.org"
Expand Down
10 changes: 5 additions & 5 deletions projects/ngx-cookie-service/src/lib/cookie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export class CookieService {
private readonly documentIsAccessible: boolean;

constructor(
@Inject(DOCUMENT) private document: Document,
@Inject(DOCUMENT) private document: any,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Angular team fixed this error with Ivy, so we can use @Inject(DOCUMENT) private document: Document

but for users who are using ViewEngine it broke the library, issues were caused by this #144 and #145

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation!

// Get the `PLATFORM_ID` so we can check if we're in a browser.
@Inject(PLATFORM_ID) private platformId
@Inject(PLATFORM_ID) private platformId,
) {
this.documentIsAccessible = isPlatformBrowser(this.platformId);
}
Expand Down Expand Up @@ -135,7 +135,7 @@ export class CookieService {
domain?: string;
secure?: boolean;
sameSite?: 'Lax' | 'None' | 'Strict';
}
},
): void;

set(
Expand All @@ -145,7 +145,7 @@ export class CookieService {
path?: string,
domain?: string,
secure?: boolean,
sameSite?: 'Lax' | 'None' | 'Strict'
sameSite?: 'Lax' | 'None' | 'Strict',
): void {
if (!this.documentIsAccessible) {
return;
Expand Down Expand Up @@ -190,7 +190,7 @@ export class CookieService {
options.secure = true;
console.warn(
`[ngx-cookie-service] Cookie ${name} was forced with secure flag because sameSite=None.` +
`More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`
`More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`,
);
}
if (options.secure) {
Expand Down
3 changes: 2 additions & 1 deletion projects/ngx-cookie-service/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
"enableResourceInlining": true,
"fullTemplateTypeCheck": true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}
2 changes: 1 addition & 1 deletion projects/ngx-cookie-service/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
"enableIvy": false
}
}
23 changes: 19 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,29 @@
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2018", "dom"],
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"paths": {
"ngx-cookie-service": ["dist/ngx-cookie-service/ngx-cookie-service", "dist/ngx-cookie-service"]
"ngx-cookie-service": [
"dist/ngx-cookie-service/ngx-cookie-service",
"dist/ngx-cookie-service"
]
}
},
"angularCompilerOptions": {
"compilationMode": "partial",
"enableIvy": false,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
"strictInjectionParameters": true,
"enableResourceInlining": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}