-
Notifications
You must be signed in to change notification settings - Fork 343
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
Support strict mode #870
Comments
any update? @corsairdnb @NetanelBasal Thank you |
Just to add a little more flavour... I have just been upgrading and saw the following Akita 7.1.1 Akita 7.1.1 |
its typescript 4.6 also working fine. |
Update NW workspace to version 14 upgrading angular to the same version and typescript up to 4.8 Closes salesforce#870
found this in the change log for Angular 15
So TypeScript 4.8+ support will quickly become very important |
Agreed! |
@NetanelBasal please have a look at the PR from @LazeKer. |
Has anyone already on this thread made the necessary changes for themselves? I just spent all day updating to Angular 14 and I thought I was going to attempt to update Akita myself but decided for now I'm reverting to TS 4.7.4 (thanks to @MussaratAziz for this version tip). |
Just run into this as well. It's been over a month since this was reported. |
@Ketec it's definitely been superseded by Elf from the same author But it's probably impractical for most to update to it - at least for a working project. @NetanelBasal hope all is well. Do you think you'll be able to update the typescript definitions anytime soon? As you know Angular 15 is imminent. It would really 'satisfies' many of us if we could use TS 4.9 :-) |
Guess this can be considered deprecated and the repository should be marked as such. It is now incompatible with the latest Angular. If there has still been no response in another 3+ weeks. |
There's a PR lying around. When there's still people carrying about it, it's not yet abandoned. It's just a transition phase. I saw that in many projects which are still not dead yet. But of course, I'd also like to a see the owner to either find a new owner (or add new maintainers) or actively maintain it. Regarding the CLA issue: does signing it with your primary email work? |
I guess this is the PR you mention: #946 |
Update NW workspace to version 14 upgrading angular to the same version and typescript up to 4.8 Closes salesforce#870
I tried it with my github account, same problem :( |
ah, I finally found the issue. I had to push a new commit so the signed CLA was found. But I'm afraid that this still won't get any attention from the maintainers |
thank you @jimjag |
So I see it's merged now. But no new release version - I assume this still needs manual builds/tagging/promotion? the latest is 7.1.1 from January. @jimjag any updates on the actual new build after merge since this issue was closed - but the fixes are not actually available. https://github.com/salesforce/akita/actions/runs/3657434264 is waiting for approval. |
Is there any news when a new version will be published? Or can I update Akita manually? |
@Donnerstagnacht It seems like a new version was published... I'm going to try it out soon |
The peerDep got set to 15+ so it's not available for 14 (can locally force it to install but will not work for cicd/prod builds like that).
|
I'm wondering why it's not happening in the repo. It uses v4.8. |
The playground? Perhaps because it's not consuming akita from installed distribution but locally in the nx workspace? I'll need to set up and test with a separate clean project to validate. |
@NetanelBasal I think it happens due to stricter compilation options. If I try to build akita with the option |
skipLibCheck also disables checking even for your own libraries or any declaration fields inside the project. You can't specify where it applies. Hiding errors and reducing code quality and adding the option for poor-quality code is not a workaround. |
Yes, it seems like changing to |
@Ketec I appreciate your input. I have added a warning to my comment to explain that this reduces the type checking accuracy. I will still leave it as a workaround to allow people to decide them self. |
Hi guys, I just stumbled on this problem while you were resuming the discussion.
and many more operators. I just wanted to let you know. Thank you. |
You can upgrade to rxjs v7. It should be seamless |
Ooops! Didn't notice that. |
The only place where i "fixed" it is in my own code where I extended the store/query for additional methods. But the types do get quite extensive and complex ex: @Injectable({ providedIn: 'root'})
export abstract class BaseQuery<S, EntityType = getEntityType<S>, IDType = getIDType<S>> extends QueryEntity<EntityState<EntityType, IDType>> {
public getEntityByUuid(id: string): EntityType | undefined {
return this.getAll({
filterBy: (entity: any) => entity?.uuid === id,
limitTo: 1
}).pop();
}
} |
This is a quick spike created to find out a way to fix akita for Angular 15+ in strict mode Refs: salesforce#870
@nunoarruda the first thing I've tried is to enable After that, I tried to fix only TS errors that I found while consuming akita@8.0.0 in my project. And such approach helped me to decrease the API surface to a couple of places, which was somehow fixed in this draft/spike #1050. Interestingly, #1050 already allowed me to consume akita in Angular 15 project with a strict mode (and without skipLibCheck). But unfortunately:
So any recommendations on these 2 subjects are welcome! Also, I'm totally ok if someone wants to use my spike to fix this issue ❤️ |
This is a quick spike created to find out a way to fix akita for Angular 15+ in strict mode Refs: salesforce#870
This PR makes the public API of Akita to be consumable in a strict typescript project Refs: salesforce#870
Hey @NetanelBasal, there's a PR available: #1050 When you have a chance, can you please review and possibly merge and release? This would unblock folks trying to use Akita v8 with Angular 15 and/or strict mode. Thanks in advance 👍 |
* fix(akita): support TS strict mode This PR makes the public API of Akita to be consumable in a strict typescript project Refs: #870 * chore(general): fix deps graph to fix build:all Add `dependsOn` for `build` to build dependencies of a project first before building the project Remove "nx/presets/npm.json" to fix deps graph (cause it disabled the analyzeSourceFiles feature)
I've released v8.0.1, please check and verify the fix so we can close the issue. |
hello, its compiles fine now, but am getting error with schematics when trying to add components or stores etc: |
@Hatooz I found in the changelog that this breaking change was a part of the previous 8.0.0 release https://github.com/salesforce/akita/blob/master/packages/akita/CHANGELOG.md#800-2023-01-09 |
For me it works. No more type errors. |
RXJs version. it requires 7, you use 6 (distinctUntilChanged was under rxjs/operators before) |
Wow, sorry for such an stupid error, my bad, fixed it by updating RXJS to v7. Thought Angular made it with the ng upgrade... Thanks!! |
Someone can help?
my store:
typescript: 4.8.4 |
@tideee2 to me it looks like an angular-cli (typescript/babel) misconfiguration Try copying your code into a newly created Angular project. Share your repro if error will remain |
Is this a regression?
No
Description
When trying to run Angular build or tests got following errors:
Steps to reproduce:
constructor(private sessionService: SessionService) {}
npm run test
ornpm run build
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
This issue is a blocker for using latest Angular with Akita
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: