You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/08/13 16:21:18 UTC

[GitHub] [druid] vogievetsky commented on a change in pull request #10271: Web console: fix json input

vogievetsky commented on a change in pull request #10271:
URL: https://github.com/apache/druid/pull/10271#discussion_r470071450



##########
File path: web-console/src/components/json-input/json-input.tsx
##########
@@ -37,6 +38,17 @@ function stringifyJson(item: any): string {
   }
 }
 
+// Not the best way to check for deep equality but good enough for what we need

Review comment:
       Here is an in depth look at it https://www.mattzeunert.com/2016/01/28/javascript-deep-equal.html
   
   TL;DR the method implemented here would not work for this case for example:
   
   `JSON.stringify({a: 1, b: 2}) !== JSON.stringify({b: 2, a: 1})`
   
   But that is ok because in practice the object output from the JSON input will be the same it later gets back. And if that check fails the worst that will happen is that the cursor would jump. It is also hard to find a decent object deep-equals library that does not come with a bunch of dependencies (as it tries to do a 100% thorough job) and a lot of file size. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org