benjamine / jsondiffpatch

Diff & patch JavaScript objects
MIT License
4.83k stars 472 forks source link

Version 0.4.0 seems broken #278

Closed slubowsky closed 4 years ago

slubowsky commented 4 years ago

After updating I get the following: ERROR in node_modules/jsondiffpatch/dist/index.d.ts:192:9 - error TS2304: Cannot find name 'HTMLFormatter'.

brasilikum commented 4 years ago

In my case it's

Unable to resolve "./empty" from "node_modules/jsondiffpatch/dist/jsondiffpatch.umd.js"
Failed building JavaScript bundle
benjamine commented 4 years ago

ouch, will take a look later today, thanks!

benjamine commented 4 years ago

@slubowsky I published 0.4.1 which I think should fix the typescript error, can you verify?

@brasilikum I couldn't reproduce that error, is that new to 0.4.0? I'll need more info on your environment to reproduce, is that on a browser? as umd version should be only for browsers, and cjs or esm for node depending on your build setup.

slubowsky commented 4 years ago

@benjamine Im not seeing a version 0.4.1...

>npm i
npm ERR! code ETARGET
npm ERR! notarget No matching version found for jsondiffpatch@0.4.1.
benjamine commented 4 years ago

🤦‍♂ forgot to npm publish, should be there now.

slubowsky commented 4 years ago

Yes. version 0.4.1 works. Thanks!

brasilikum commented 4 years ago

@brasilikum I couldn't reproduce that error, is that new to 0.4.0? I'll need more info on your environment to reproduce, is that on a browser? as umd version should be only for browsers, and cjs or esm for node depending on your build setup.

Yes, that error was new in 0.4.0 but it's gone in 0.4.1, so I guess that was what my webpack turned the error into. I am using it with react native. Expo does not print any color so I use your package to print diffs in my react state and messages.

Thank you very much for this module and your quick response and fix!

benjamine commented 4 years ago

@brasilikum nice! (would love to see a screenshot of that, just curious) thanks both!

brasilikum commented 4 years ago

Sure, here you go:

Screen Shot 2020-01-03 at 12 03 50 PM

The logger is a middleware with some 10 lines of code. It's really only using the diff function on the state and the console formatter