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

Fix Grid formatters errors in dev mode #5682

Closed
edloidas opened this issue Jan 5, 2023 · 0 comments · Fixed by #5683
Closed

Fix Grid formatters errors in dev mode #5682

edloidas opened this issue Jan 5, 2023 · 0 comments · Fixed by #5683
Assignees
Labels
Bug Something isn't working Not in Changelog
Milestone

Comments

@edloidas
Copy link
Member

edloidas commented Jan 5, 2023

It's not possible to use "destructing" syntax in formatter function's parameter, like this:

public static nameFormatter({}: any, {}: any, {}: any, {}: any, dataContext: TreeNode<SettingsViewItem>) {
  // ...
}

Because the fourth parameter may be undefined in case of an empty nodes that we use to track the postLoad function calls.
When this parameter is undefined, the transpiled code in dev mode will throw the error, when the value is passed to the destructing function, generated by swc

function _objectDestructuringEmpty(e) {
    if (null == e) throw new TypeError("Cannot destructure " + e);
    return e;
}
@edloidas edloidas added the Bug Something isn't working label Jan 5, 2023
@edloidas edloidas added this to the 5.0 milestone Jan 5, 2023
@edloidas edloidas self-assigned this Jan 5, 2023
edloidas added a commit that referenced this issue Jan 5, 2023
Removed parameter destructing from the formatter functions, because it will lead to errors, when one of the arguments is undefined.
Moved lib-admin-ui tasks exclusion to the separate file.
Added `clean` Gradle task call in lib-admin-ui, when clean is called in the project.
@edloidas edloidas linked a pull request Jan 5, 2023 that will close this issue
alansemenov pushed a commit that referenced this issue Jan 5, 2023
Removed parameter destructing from the formatter functions, because it will lead to errors, when one of the arguments is undefined.
Moved lib-admin-ui tasks exclusion to the separate file.
Added `clean` Gradle task call in lib-admin-ui, when clean is called in the project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Not in Changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants