-
Notifications
You must be signed in to change notification settings - Fork 373
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
fix(translations): memoize array translation #2358
fix(translations): memoize array translation #2358
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@LukasBoll Can you fix the build or do you need support? |
862b6bc
to
0e697e7
Compare
0e697e7
to
6f275fb
Compare
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @sdirix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good in general. However there seems to be an issue in Vue Vanilla. When checking the "Nested arrays" example and adding a new element to the outer array, then the nested array within it crashes. Can you check what's going on?
This is the error message:
TypeError: Cannot read properties of undefined (reading 'noDataMessage')
at Proxy.render$l (ArrayListRenderer.vue:44:31)
at renderComponentRoot (runtime-core.esm-bundler.js:887:16)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:6020:46)
at ReactiveEffect.run (reactivity.esm-bundler.js:177:19)
at instance.update (runtime-core.esm-bundler.js:6151:16)
at setupRenderEffect (runtime-core.esm-bundler.js:6161:5)
at mountComponent (runtime-core.esm-bundler.js:5929:7)
at processComponent (runtime-core.esm-bundler.js:5883:9)
at patch (runtime-core.esm-bundler.js:5351:11)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:6027:11)
This commit addresses an issue where array translations were created as new objects within the core module for each render cycle, causing unnecessary rerenders. By memoizing the translation object in the material renderer set, this commit prevents redundant rerenders. This commit also adds memorization to the attributes of the material oneOfRenderer to further avoid unnecessary rerendering. closes eclipsesource#2342
6f275fb
to
0523417
Compare
@LukasBoll Can you resolve the conflicts? |
; Conflicts: ; packages/vanilla-renderers/src/complex/array/ArrayControlRenderer.tsx
Merge commit only fixes a tiny merge conflict. |
This commit addresses an issue where array translations were created as new objects within the core module for each render cycle, causing unnecessary rerenders. By memoizing the translation object in the material renderer set, this commit optimizes performance and prevents redundant rerenders.