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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to