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

feat: pass localElements to restore and restoreElement API's and bump versions of duplicate elements on import #3797

Merged
merged 12 commits into from
Jul 4, 2021

Conversation

dwelle
Copy link
Member

@dwelle dwelle commented Jul 4, 2021

fix #3795

unsure of whether to supply localElements in some cases, but that also applies to current localAppState.

  • update readme
  • update changelog

@dwelle dwelle requested a review from ad1992 July 4, 2021 16:21
@vercel
Copy link

vercel bot commented Jul 4, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/7MAe3witCGE1FNopV3yA6X2fRHgF
✅ Preview: https://excalidraw-git-bumpversionsonimport-excalidraw.vercel.app

src/data/restore.ts Show resolved Hide resolved
src/data/restore.ts Show resolved Hide resolved
src/data/restore.ts Show resolved Hide resolved
Copy link
Member

@ad1992 ad1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the docs as well ?

src/tests/data/restore.test.ts Outdated Show resolved Hide resolved
src/tests/data/restore.test.ts Outdated Show resolved Hide resolved
# Conflicts:
#	src/packages/excalidraw/CHANGELOG.md
src/packages/excalidraw/CHANGELOG.md Show resolved Hide resolved
src/packages/excalidraw/README_NEXT.md Outdated Show resolved Hide resolved
src/packages/excalidraw/README_NEXT.md Outdated Show resolved Hide resolved
src/packages/excalidraw/README_NEXT.md Outdated Show resolved Hide resolved
src/packages/excalidraw/CHANGELOG.md Show resolved Hide resolved
src/packages/excalidraw/README_NEXT.md Outdated Show resolved Hide resolved
</pre>

See [`restoreAppState()`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#restoreAppState) about `localAppState`, and [`restoreElements()`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#restoreElements) about `localElements`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are mentioning in line 751 to check the definition of restoreElements and restoreAppState so this can be removed

Copy link
Member Author

@dwelle dwelle Jul 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's obvious enough those arguments are related to those functions. IMO the API docs should be self-contained.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok let's keep it 👍🏻 , I think we should instead explain every arg here though redundant instead of redirecting to other restore methods to make it more clear but we can do that later.

@ad1992 ad1992 changed the title fix: bump versions of duplicate elements on import feat: pass localElements to restore and restoreElement API's and bump versions of duplicate elements on import Jul 4, 2021
Copy link
Member

@ad1992 ad1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the pr title to use feat instead of fix

@dwelle
Copy link
Member Author

dwelle commented Jul 4, 2021

🎉

@dwelle dwelle merged commit 0973626 into master Jul 4, 2021
@dwelle dwelle deleted the bump_versions_on_import branch July 4, 2021 20:23
@dwelle
Copy link
Member Author

dwelle commented Jul 4, 2021

that PR title tho :) — my 80-char terminal won't be pleased

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

Successfully merging this pull request may close these issues.

importing a file replaces elements and reverts versions
2 participants