nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 397 forks source link

Tui Grid pollute original data while presenting data in table #1755

Open dev-hobeoung opened 2 years ago

dev-hobeoung commented 2 years ago

When using tui-grid, it seems to work by adding properties such as rowKey and sortKey to the passed data.

This method seems to have the following problems. First, it pollutes the original data in the Presentation Layer. I don't think most people would expect the original data to be transformed in the process of presenting it in a table. Second, immutable objects cannot be used. In particular, since many state management libraries such as Redux manage objects immuatably, usability is limited in many case.

Even if it consumes a little more memory, it is suggested to manage it separately through depensive copy inside the tui grid.

== tui-grid 사용 시, 넘겨준 데이터에 rowKey, sortKey 등의 속성을 추가하는 방법으로 동작하는 것 같습니다.

해당 방식은 다음과 같은 문제점을 가지고 있을 것으로 보여집니다. 첫번째, 원본 데이터를 Presentation Layer에서 오염시킵니다. 대부분의 사람들은 테이블에 데이터를 보여주는 과정에서 원본 데이터가 변형될 것이라고 예상하지 못할 것 같습니다. 두번째, immutable 객체는 사용이 불가능합니다. 특히, Redux 등 다수의 상태관리 라이브러리에서 객체를 immuatable하게 관리하기 때문에 많은 케이스에서 사용성이 제한됩니다.

약간의 메모리를 더 소비하더라도 tui grid 내부에서 depensive copy를 통해 따로 관리하는 방안을 제안합니다.

dev-hobeoung commented 2 years ago

It's label must be changed to 'Bug Report' to 'Feature Request'

jajugoguma commented 1 year ago

Sorry for late replying.

I agree with you, so I'll fix it. Thanks!