-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Example 22 keeps formatter components alive outside of grid #1269
Comments
So as far as I understand the approach, you're rendering an angular component to DOM and afterwards simply duplicating its innerhtml to the cells innerhtml. That means 2 things:
Its late over here, but if you dont have any concrete idea where the issue is located I can try to dig in tomorrow in the evening |
hmm I wasn't aware of that, I got so many ports it's hard to test every little detail but the creation of dynamic Angular component is all in angularUtil.service.ts which is also used by the Row Detail feature. There were some changes I've done recently to support Angular 16 in this commit since the original code got deprecated and is no longer supported, not sure if that has any effect, to tell you the truth I never used this feature neither the Row Detail because I always stick with JS custom formatters since that is synchronous and the ideal solution |
yeah I got the idea why classic formatters are preferrable. trouble is though if based on the field and value an async value must be looked up. worst case one could create a mapped field where the intended value is already available through joins/maps and reuse that. but back to the issue itself. so the underlying bug is that the element is actually supposed to be deleted but that doesnt work for whatever reason right? this way I have at least a bit of guidance of what to aim for while looking for a fix EDIT: guess we need to look into removing it via ViewContainerRef.remove instead CompinentRef.destroy which might keep it around if there is still a ref around |
hmm there might be the |
@zewa666 I got a question to some code change you've done in the past, so I recently migrated the original SlickGrid to TypeScript and one person is complaining that the The code you introduced back then was I told him that if he wants to use interfaces, then he should extend The code type PathsToStringProps<T> = T extends string | number | boolean | Date ? [] : {
[K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>]
}[Extract<keyof T, string>];
type Join<T extends any[], D extends string> =
T extends [] ? never :
T extends [infer F] ? F :
T extends [infer F, ...infer R] ?
F extends string ? string extends F ? string : `${F}${D}${Join<R, D>}` : never : string;
interface Column {
field: Join<PathsToStringProps<T>, '.'>;
} I guess he could do something like this to bypass the problem columnDefinitions: Column<MyItem & { [field: string]: string; }>[]; |
I'm currently re-evaluating your slickgrid wrappers for a larger rewrite of an angular app in my company. Part of that might include something similar due to the mostly generic nature. So let me read up on that and I'll reply in the other issue with either a solution or more questions. |
@ghiscoding hey quick question, how are you building and getting angular-slickgrid ready to work with? I've tried installing the master branch via pnpm but end up with various issues once I run |
I'm not exactly sure what you mean, on the project itself I use Yarn classic and for the plugin build I use packagr which is the most known lib for packaging plugins. Do you mean some kind of contribution guide? If so, yeah it looks like I missed adding one |
well, essentially I'd like to install deps and run the start script, so that once I change things around I can live-view the examples to see the effects. Currently I do all of these errors
so install + start script seems not to be enough, there are some steps missing |
I added the Contributions steps, I added Tasks in VSCode (via |
That one is my lib, I rewrote if you think my exports are wrong, please let me know but apart from that I don't understand why you have all these errors, I don't see any of them when using Yarn classic on multiple computers (4x different computers in my case) |
I dunno, perhaps it just doesnt like windows :( but may I ask you to do a fresh clone of the repository to a different folder and see whether install + start work there? I dunno I really can't believe I'm seeing all these crazy issues. |
I'm exclusively on Windows but yes I have the project on my computers for a while, not fresh copies. I can try that. Have you tried with Yarn classic at all? |
yep. everything with pnpm and yarn classic, always with fresh checkouts.
|
ok got it running now. The main issue was
switching back to "builder": "@angular-devkit/build-angular:browser", fixed it for me. So I really wonder how on earth this worked at all for you 🤣 |
well I don't know but I still have no error after a fresh copy and these kind of errors would have shown up in the CI since I do a website prod build then I use a simple http server to run the Cypress E2E tests in CI yarn build (no error)yarn start (also no error)lol I don't know why we get different results 😆 I wouldn't mind receiving a PR for the polyfill change though |
yep, I found the issue for the attached components and just finalizing the Cypress tests. After that you'll get a PR including the polyfills fix |
you can also remove the esbuild if it's causing issue, especially for external contributors like you, better play safe and keep these experimental stuff for the future 😆 |
fix(demo): cleanup angular component in Example22 after asyncPostRenderer done, fixes #1269
@zewa666 I tried with Maybe something like this SO Prevent ng-template from being rendered in transclusion it happens very fast, I only managed to see it after adding a breakpoint for a tree change, these temp ng-template are what will show in the 3rd column "Assignee with Angular Component". I don't I had that problem originally and I think it's recent |
@zewa666 It would be really nice if you could do a review of the PR, I still need to add unit tests to cover the new change but I'll do that tomorrow |
Describe the bug
It seems that custom formatters with angular, so asyncPostRenders, are polluting the DOM.
Reproduction
JohnPaulPaulPierrePaulPaulJohnPaulPaulPierrePaul
Expectation
Should not be kept as a clone
Environment Info
Validations
The text was updated successfully, but these errors were encountered: