-
Notifications
You must be signed in to change notification settings - Fork 95
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
Memory leaks with and
and or
after they were converted to class based helpers
#205
Comments
Okay, so an update here: I have yet to create a minimal reproduction. It might be linked to happening only in-combination with a memory leak regression i found in ember-intl. That said, when Class based helpers are being considered a legacy feature (according to https://github.com/chancancode/ember-serviceable-helper?tab=readme-ov-file#motivation), and since (some sort of) ember-truth-helpers are considered for inclusion in ember by default (according to https://polaris-starter.pages.dev/), I think this repository should strive for being pure functions only. |
Hi @johanrd! Thank you for reporting this! Could you please confirm you still see the issue after ember-intl/ember-intl#1848 got fixed and released? As for class based helpers - you can see discussion when this decision was made #188 (comment) as that was the way to make Glint types work with generics. |
@SergeAstapov Thanks for your reply. Closing for now, as I have yet to pin it to a simple reproduction. It may have been related to ember-intl/ember-intl#1848 and/or glimmerjs/glimmer-vm#1440. Thanks also for the pointer to #188 (comment). It surely does not feel right to use class based helper in such a 'plain' function, but if the only other option is to embed it into the vm, I think it can wait. thanks, |
After long nights of debugging memory leaks, I found an issue with the
and
andor
helpers from ember-truth-helpers, after they were converted to class based helpers. E.g. when using them with ember-template-imports:Here
ProjectList
andEquimpentList
yields a resource, similar to reactiveweb's RemoteData or glimmer-apollo's useQuery.Components inside the Dashboard that consume
isLoading
are simply retained in memory after exiting the route, and multiplying in memory every time the route is re-entered.Converting to a pure functional helper fixed the leak. Also – as proof of concept – the following use of double
not
-helper also fixed the leak (as thenot
-helper is still a pure function helper)@SergeAstapov I am not 100% sure about what runtime problem / use case the the change to class based helper solved, so therefore I'm also not sure whether the change is worth it. (yet the compile time typescript generics should be solvable without needing to convert to a class, I think)
ember-truth-helpers/packages/ember-truth-helpers/src/helpers/or.ts
Lines 25 to 27 in 93ba8bc
Posting the issue now, without a link to a reproducible repository, in case others need a hint of the issue before I pull together something more reproducible.
best regards,
johan
The text was updated successfully, but these errors were encountered: