Skip to content

Conversation

dantehemerson
Copy link

@dantehemerson dantehemerson commented Mar 2, 2024

It adds support to export and import the diff.

The exported data goes in the URL in the d query param.
You can test the new functionality on this URL:

https://json-diff2.netlify.app?d=%7B%22left%22%3A%22%7B%5Cn%20%20%5C%22jsonShared%5C%22%3A%20true%2C%5Cn%20%20%5C%22version%5C%22%3A%20254%2C%5Cn%20%20%5C%22versionNonce%5C%22%3A%20179716985%5Cn%7D%22%2C%22right%22%3A%22%7B%5Cn%20%20%5C%22version%5C%22%3A%20254%2C%5Cn%20%20%5C%22newField%5C%22%3A%20%5C%22Hi%5C%22%2C%5Cn%20%20%5C%22versionNonce%5C%22%3A%20179716985%5Cn%7D%22%7D

Limitations
The maximum exportable difference size is constrained by the browser's maximum URL length, which is 4000 characters.
When it occurs, the app shows an alert notifying the error.

Though the limit seem short in JSON terms, some individuals, including myself, might find it useful for simple JSON data.

In case this PR don't gets merged, I deployed the app with this functionality on:
https://json-diff2.netlify.app

@dantehemerson dantehemerson changed the title feat: Add support to import and export using url param feat: Add support to import and export using URL param Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant