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

feat(lib): use TestBed.get if .inject falsy - back compatibility (#283) #284

Merged

Conversation

Coffee-Tea
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?
Backward compatibility change.
Allow to use 5.x lib version for Angular version less than v9.
Keep to use for Angular v9 as is.

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #283

What is the new behavior?

You can continue using the latest version of Spectator in you Angular projects with version less than 9 (e.g. 7, 8 etc.)

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@NetanelBasal
Copy link
Member

NetanelBasal commented Mar 3, 2020

You need to update the peerDependencies.

"@angular/common": "^9.0.1",
"@angular/core": "^9.0.1",
"@angular/router": "^9.0.1",
"@angular/common": "^8.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't include v9. You need to use a range.

"@angular/router": "^9.0.1",
"@angular/common": ">= 8.0.0",
"@angular/core": ">= 8.0.0",
"@angular/router": ">= 8.0.0",
"typescript": ">= 3.7.0"
Copy link
Member

Choose a reason for hiding this comment

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

"typescript": ">= 2.8.0"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me check with this version of typescript,
I haven't checked it and not sure there are no new typescript features that are used in code which will not work with 2.8.0.

I will update you

Copy link
Contributor Author

@Coffee-Tea Coffee-Tea Mar 4, 2020

Choose a reason for hiding this comment

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

@NetanelBasal I would put "typescript": ">= 3.5.3" or smth like that b/c there are a bunch of errors when using 2.8.0. Actually, 3.5.3 was used as dependency in the root package.json:
e13c955#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L77

Here is a part of errors I'm getting with 2.8.0:
image

Please confirm

Copy link
Member

Choose a reason for hiding this comment

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

This was the lastest version before we released v5:

"typescript": ">= 2.8.0"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@NetanelBasal yes you're right, but what is goal of peerDependencies? Maybe I'm wrong but should not we specify versions which gonna work with other specified peerDependencies versions?
I assume that it was wrong with >= 2.8.0 but if you're ok I will get back to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've used 8.2.0, my bad, but even typescript 3.0.0 was not working with 8.2.0.
Angular 8.2.0 was properly working with typescript 3.5.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me check 2.8.0 with 8.0.0

Copy link
Contributor Author

@Coffee-Tea Coffee-Tea Mar 4, 2020

Choose a reason for hiding this comment

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

Doesn't work for me trying 2.8.0 with 8.0.0,
also 8.0.0 angular is using 3.4.2 version https://github.com/angular/angular/blob/38a7e2a775d2c3495a8574dde7d1a7106dd0ae04/package.json#L108

so I'm really unsure in 2.8.0 but pushed it. It doesn't break anything, just seems to be smth like disinformation.

Copy link
Member

Choose a reason for hiding this comment

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

The TS version depends on your Angular version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that what I mean, and I'm not sure that TS 2.8.0 is compatible with Angular 8.0.0 :)

@NetanelBasal NetanelBasal merged commit e39a75a into ngneat:master Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants