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

Replace vue-clipboard2 with Vue3 compatible lib #9536

Closed
cnotv opened this issue Aug 15, 2023 · 3 comments · Fixed by #10072
Closed

Replace vue-clipboard2 with Vue3 compatible lib #9536

cnotv opened this issue Aug 15, 2023 · 3 comments · Fixed by #10072
Assignees
Labels
area/upgrade kind/tech-debt Technical debt size/3 Size Estimate 3
Milestone

Comments

@cnotv
Copy link
Contributor

cnotv commented Aug 15, 2023

Description

Replace current library vue-clipboard2 with alternative, e.g. useClipboard as component.

Context

As identified in the migration report, it is not possible to use the same library for clipboard functionalities.

As defined in #9842 we have 2 components for this and we may take the chance to deal with that as well.

The replacement should affect pretty much 3 places: Vue setup, Jest setup and component.

@nwmac
Copy link
Member

nwmac commented Sep 12, 2023

Note: Work can be started now, but should be merged after 2.8.0

@gaktive gaktive modified the milestones: v2.8.0, v2.8.next1 Sep 22, 2023
@richard-cox
Copy link
Member

richard-cox commented Oct 18, 2023

See https://github.com/Inndy/vue-clipboard2. The functionality we need to update revolve around $copyText (CopyCode, CopyToClipboard, CopyToClipboardText, StatusTable) and v-clipboard (couldn't find this). Need to understand if textContent is available without this lib as well

@nwmac
Copy link
Member

nwmac commented Nov 23, 2023

@eva-vashkevich I think we just use the $copyText function of the library to copy to the clipboard.

I think we can just use https://github.com/lgarron/clipboard-polyfill - we probably could get away with the new navigator.clipboard.writeText API, but the polyfill would ensure we have the widest browser compatibility.

I think it should be a straight-forward swap in - I'd suggest creating a file clipboard.js in utils that exports a copyTextToClipboard function that uses the polyfill to copy to clipboard (or could use the new API directly) and then replace usages of $copyText with calls to that exported function (need to import it into relevant components etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/upgrade kind/tech-debt Technical debt size/3 Size Estimate 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants