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

Import statement for jsdiff #199

Closed
harmeetjaipur opened this issue Oct 6, 2017 · 4 comments
Closed

Import statement for jsdiff #199

harmeetjaipur opened this issue Oct 6, 2017 · 4 comments

Comments

@harmeetjaipur
Copy link

Hi, I have been looking for a good diff checker that can deal with html inside the content and your project seems like it can deal with that.

I feel stupid asking this but what is the import name for jsdiff for ReactJs? I tried import JsDiff from 'diff' but JsDiff stays undefined.

@harmeetjaipur
Copy link
Author

Found the '*' solution on another post.

@devloe
Copy link

devloe commented May 2, 2018

Can you post the solution here?

@Martii
Copy link
Contributor

Martii commented Jan 7, 2019

@devloe
This is the core npmjs.com package at https://www.npmjs.com/package/diff . So package.json item should be, at current, "diff": "4.0.1"

Seems there is some current README.md issues too with using JsDiff (ex. here and a bunch of other places in this DOC)... almost skipped this update with diff@4.0.1 since it failed in usage tests. Had to change JsDiff Object reference in DOM script to plain Diff. Cc: @kpdecker

Martii added a commit to Martii/OpenUserJS.org that referenced this issue Jan 7, 2019
* Bump project version... shouldn't be going back from this point DB wise. We have a few days of backups already with most changes made.
* Official change to odd numbered *node* version to partially work-around mitigate OpenUserJS#1548 . Somewhere around May 2019 is when 12 becomes current. 10 just "isn't doing it" for the moment. This should be reversible but not a guarantee. We are still having timeouts to AWS/mLabs.
* Official mitigation of *mongoose* See Automattic/mongoose#7355 (comment) . This may be helping a little but not much. Declining slope in mLabs but could be decline in user interaction too.
* Please read their CHANGELOGs
* Delete op retested
* Repair, yet to be documented, *diff* breaking change with `JsDiff` to `Diff` Object reference. See kpdecker/jsdiff#199 (comment)
Martii added a commit to OpenUserJS/OpenUserJS.org that referenced this issue Jan 7, 2019
* Bump project version... shouldn't be going back from this point DB wise. We have a few days of backups already with most changes made.
* Official change to odd numbered *node* version to partially work-around mitigate #1548 . Somewhere around May 2019 is when 12 becomes current. 10 just "isn't doing it" for the moment. This should be reversible but not a guarantee. We are still having timeouts to AWS/mLabs.
* Official mitigation of *mongoose* See Automattic/mongoose#7355 (comment) . This may be helping a little but not much. Declining slope in mLabs but could be decline in user interaction too.
* Please read their CHANGELOGs
* Delete op retested
* Repair, yet to be documented, *diff* breaking change with `JsDiff` to `Diff` Object reference. See kpdecker/jsdiff#199 (comment)

Auto-merge
@clouedoc
Copy link

clouedoc commented Apr 26, 2021

The * solution if anyone is wondering. Thanks to the OP.

import * as Diff from "diff";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants