Skip to content

Update clipboard dependency to at least 2.0.1#10739

Merged
gziolo merged 7 commits intoWordPress:masterfrom
blowery:chore/update-clipboard-package
Oct 19, 2018
Merged

Update clipboard dependency to at least 2.0.1#10739
gziolo merged 7 commits intoWordPress:masterfrom
blowery:chore/update-clipboard-package

Conversation

@blowery
Copy link
Copy Markdown
Contributor

@blowery blowery commented Oct 18, 2018

This upgrades the clipboard dependency.

This does not yet update the package-lock.json in the root of the repo; it's unclear to me how that's supposed to happen with the lerna setup.

Description

This upgrades the clipboard dependency to at least 2.0.1, which resolves a possible conflict with the browser global Clipboard.

See https://github.com/zenorocha/clipboard.js/releases for release notes

How has this been tested?

  • Publish a new post
  • Use the Copy Link button in the post publish panel to copy the link to the clipboard

Types of changes

Dependency update

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

This upgrades the clipboard dependency to at least 2.0.1, which resolves a possible conflict with the browser global Clipboard.

See https://github.com/zenorocha/clipboard.js/releases for release notes
@gziolo gziolo added this to the 4.1 - UI freeze milestone Oct 18, 2018
@gziolo gziolo added the [Package] Components /packages/components label Oct 18, 2018
@talldan
Copy link
Copy Markdown
Contributor

talldan commented Oct 19, 2018

Looks like CI is failing, and when testing locally I'm seeing UNMET DEPENDENCY clipboard@2.0.1. Seems to be an issue with the package-lock. Could be related to the version of NPM you're running @blowery.

When I tried removing the package-lock and re-installing (using npm v6.4.1), this is the diff I got:

diff --git a/package-lock.json b/package-lock.json
index ddda05ddf..c5f98d602 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2146,17 +2146,6 @@
 				"react-dates": "^17.1.1",
 				"rememo": "^3.0.0",
 				"uuid": "^3.1.0"
-			},
-			"dependencies": {
-				"clipboard": {
-					"version": "2.0.1",
-					"bundled": true,
-					"requires": {
-						"good-listener": "^1.2.2",
-						"select": "^1.1.2",
-						"tiny-emitter": "^2.0.0"
-					}
-				}
 			}
 		},
 		"@wordpress/compose": {
@@ -5124,6 +5113,16 @@
 			"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
 			"dev": true
 		},
+		"clipboard": {
+			"version": "2.0.1",
+			"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.1.tgz",
+			"integrity": "sha512-7yhQBmtN+uYZmfRjjVjKa0dZdWuabzpSKGtyQZN+9C8xlC788SSJjOHWh7tzurfwTqTD5UDYAhIv5fRJg3sHjQ==",
+			"requires": {
+				"good-listener": "^1.2.2",
+				"select": "^1.1.2",
+				"tiny-emitter": "^2.0.0"
+			}
+		},
 		"cliui": {
 			"version": "4.1.0",
 			"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",

and things worked fine after that.

@talldan
Copy link
Copy Markdown
Contributor

talldan commented Oct 19, 2018

If you want to cherry-pick the commit with those changes onto your branch, I've pushed it - 44ac27d

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Oct 19, 2018

Thanks @talldan, I applied your package-lock.json, testing it locally as I see some additional changes in fsevents package.

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Oct 19, 2018

Huh, now it's exactly the same as the diff Dan shared 🎉

Merging whenever Travis is happy :)

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Oct 19, 2018

I did sanity check, you can still use the copy feature in the More Menu 👍

@gziolo gziolo merged commit 0e155bd into WordPress:master Oct 19, 2018
@blowery
Copy link
Copy Markdown
Contributor Author

blowery commented Oct 19, 2018

Thanks @talldan! I'm running 6.4.1 here too. Out of curiosity, what OS did you run that on? Did you run that command inside a docker container or on the host?

@blowery blowery deleted the chore/update-clipboard-package branch October 19, 2018 11:18
@talldan
Copy link
Copy Markdown
Contributor

talldan commented Oct 22, 2018

Hey @blowery - using Mac OS X High Sierra, ran the command on the host machine.

Very strange that it produced different output with the same version. Eh, NPM 🤷‍♂️ .

antpb pushed a commit to antpb/gutenberg that referenced this pull request Oct 26, 2018
* Update clipboard dependency to at least 2.0.1

This upgrades the clipboard dependency to at least 2.0.1, which resolves a possible conflict with the browser global Clipboard.

See https://github.com/zenorocha/clipboard.js/releases for release notes

* take the update to package-lock offered by npm i

* take another update to package-lock from a second run

* package-lock after removing lock entirely and rerunning npm i

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants