{"action":"created","comment":{"url":"https://api.github.com/repos/uuid-rs/uuid/pulls/comments/236638291","pull_request_review_id":178750612,"id":236638291,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjYzODI5MQ==","diff_hunk":"@@ -160,11 +160,47 @@ mod std_support;\n mod test_util;\n #[cfg(feature = \"u128\")]\n mod u128_support;\n-#[cfg(feature = \"v3\")]\n+#[cfg(all(\n+    feature = \"v3\",\n+    any(\n+        not(target_arch = \"wasm32\"),\n+        all(\n+            target_arch = \"wasm32\",\n+            any(\n+                all(feature = \"stdweb\", not(feature = \"wasm-bindgen\")),\n+                all(feature = \"wasm-bindgen\", not(feature = \"stdweb\"))\n+            )\n+        )\n+    )\n+))]\n mod v3;\n-#[cfg(feature = \"v4\")]\n+#[cfg(all(\n+    feature = \"v4\",\n+    any(\n+        not(target_arch = \"wasm32\"),\n+        all(\n+            target_arch = \"wasm32\",\n+            any(\n+                all(feature = \"stdweb\", not(feature = \"wasm-bindgen\")),\n+                all(feature = \"wasm-bindgen\", not(feature = \"stdweb\"))\n+            )\n+        )\n+    )\n+))]\n mod v4;\n-#[cfg(feature = \"v5\")]\n+#[cfg(all(\n+    feature = \"v5\",\n+    any(\n+        not(target_arch = \"wasm32\"),\n+        all(\n+            target_arch = \"wasm32\",\n+            any(\n+                all(feature = \"stdweb\", not(feature = \"wasm-bindgen\")),","path":"src/lib.rs","position":42,"original_position":42,"commit_id":"0ccfd12fdef708d9253c9b9b9c0ece45727fd051","original_commit_id":"0ccfd12fdef708d9253c9b9b9c0ece45727fd051","user":{"login":"Dylan-DPC","id":12371125,"node_id":"MDQ6VXNlcjEyMzcxMTI1","avatar_url":"https://avatars1.githubusercontent.com/u/12371125?v=4","gravatar_id":"","url":"https://api.github.com/users/Dylan-DPC","html_url":"https://github.com/Dylan-DPC","followers_url":"https://api.github.com/users/Dylan-DPC/followers","following_url":"https://api.github.com/users/Dylan-DPC/following{/other_user}","gists_url":"https://api.github.com/users/Dylan-DPC/gists{/gist_id}","starred_url":"https://api.github.com/users/Dylan-DPC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dylan-DPC/subscriptions","organizations_url":"https://api.github.com/users/Dylan-DPC/orgs","repos_url":"https://api.github.com/users/Dylan-DPC/repos","events_url":"https://api.github.com/users/Dylan-DPC/events{/privacy}","received_events_url":"https://api.github.com/users/Dylan-DPC/received_events","type":"User","site_admin":false},"body":"do we need both features to be mutually exclusive? what will happen if this condition doesn't exist and both features exist?","created_at":"2018-11-27T12:19:16Z","updated_at":"2018-11-27T12:19:53Z","html_url":"https://github.com/uuid-rs/uuid/pull/351#discussion_r236638291","pull_request_url":"https://api.github.com/repos/uuid-rs/uuid/pulls/351","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/uuid-rs/uuid/pulls/comments/236638291"},"html":{"href":"https://github.com/uuid-rs/uuid/pull/351#discussion_r236638291"},"pull_request":{"href":"https://api.github.com/repos/uuid-rs/uuid/pulls/351"}}},"pull_request":{"url":"https://api.github.com/repos/uuid-rs/uuid/pulls/351","id":233812433,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzODEyNDMz","html_url":"https://github.com/uuid-rs/uuid/pull/351","diff_url":"https://github.com/uuid-rs/uuid/pull/351.diff","patch_url":"https://github.com/uuid-rs/uuid/pull/351.patch","issue_url":"https://api.github.com/repos/uuid-rs/uuid/issues/351","number":351,"state":"open","locked":false,"title":"Feature/wasm","user":{"login":"zrzka","id":1084172,"node_id":"MDQ6VXNlcjEwODQxNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/1084172?v=4","gravatar_id":"","url":"https://api.github.com/users/zrzka","html_url":"https://github.com/zrzka","followers_url":"https://api.github.com/users/zrzka/followers","following_url":"https://api.github.com/users/zrzka/following{/other_user}","gists_url":"https://api.github.com/users/zrzka/gists{/gist_id}","starred_url":"https://api.github.com/users/zrzka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zrzka/subscriptions","organizations_url":"https://api.github.com/users/zrzka/orgs","repos_url":"https://api.github.com/users/zrzka/repos","events_url":"https://api.github.com/users/zrzka/events{/privacy}","received_events_url":"https://api.github.com/users/zrzka/received_events","type":"User","site_admin":false},"body":"# Description\r\n\r\nThis PR adds two new features:\r\n\r\n* `stdweb`\r\n* `wasm-bindgen`\r\n\r\nThese features are kind of _passthrough_ features, because they do nothing in the `uuid` crate itself. They're just passed to the `rand` crate to make the `uuid` crate working for the `wasm32-unknown-unknown` target.\r\n\r\n# Motivation\r\n\r\nI'm unable to generate random UUID (v4) when this crate is compiled for the `wasm32-unknown-unknown` target.\r\n\r\n# Tests\r\n\r\nI just added these features ...\r\n\r\n```\r\n- cargo test --features \"v3\"\r\n- cargo test --features \"v3 stdweb\"\r\n- cargo test --features \"v3 wasm-bindgen\"\r\n```\r\n\r\n... for all `v3` & `v4` & `v5` (`rand` crate is used in all these features) to the `script` section in the `.travis.yml`.\r\n\r\nNot sure if it makes sense, but it can demonstrate that it's buildable at least.\r\n\r\nI don't think that more tests are required unless you'd like to bring the whole `wasm-bindgen`, `wasm-pack`, ... machinery here. And it has no sense to do it, because goal of this PR is not to publish `uuid-rs` NPM package, just add the ability to compile & use it from the `wasm32-unknown-unknown` target.\r\n\r\n# Related Issue(s)\r\n\r\n* #350\r\n* [now() doesn't work](https://github.com/balena-io-modules/balena-temen/issues/37)\r\n\r\n# Manual tests\r\n\r\nMy Cargo.toml:\r\n\r\n```\r\n[dependencies]\r\nuuid = { features = [\"v4\"], git = \"https://github.com/zrzka/uuid.git\", branch = \"feature/wasm\" }\r\n\r\n[target.wasm32-unknown-unknown.dependencies]\r\nuuid = { features = [\"wasm-bindgen\"], git = \"https://github.com/zrzka/uuid.git\", branch = \"feature/wasm\" }\r\n```\r\n\r\nMy `index.js`:\r\n\r\n```\r\nconst bt = require('balena-temen');\r\n\r\nconsole.log(\r\n    bt.evaluate({\r\n        \"id\": {\r\n            \"$$eval\": \"uuidv4()\"\r\n        }\r\n    })\r\n);\r\n```\r\n\r\n[uuidv4() implementation](https://github.com/balena-io-modules/balena-temen/blob/master/src/builtin/function/uuidv4.rs#L9-L11).\r\n\r\nOutput:\r\n\r\n```\r\n{ id: 'cefa2919-ff48-48ef-a231-e13697e23ed2' }\r\n```\r\n","created_at":"2018-11-27T08:00:22Z","updated_at":"2018-11-27T12:19:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75f8ef433361c41516ffaa01d9075fa0d0e9f962","assignee":null,"assignees":[],"requested_reviewers":[{"login":"KodrAus","id":6721458,"node_id":"MDQ6VXNlcjY3MjE0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6721458?v=4","gravatar_id":"","url":"https://api.github.com/users/KodrAus","html_url":"https://github.com/KodrAus","followers_url":"https://api.github.com/users/KodrAus/followers","following_url":"https://api.github.com/users/KodrAus/following{/other_user}","gists_url":"https://api.github.com/users/KodrAus/gists{/gist_id}","starred_url":"https://api.github.com/users/KodrAus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KodrAus/subscriptions","organizations_url":"https://api.github.com/users/KodrAus/orgs","repos_url":"https://api.github.com/users/KodrAus/repos","events_url":"https://api.github.com/users/KodrAus/events{/privacy}","received_events_url":"https://api.github.com/users/KodrAus/received_events","type":"User","site_admin":false},{"login":"kinggoesgaming","id":15664607,"node_id":"MDQ6VXNlcjE1NjY0NjA3","avatar_url":"https://avatars0.githubusercontent.com/u/15664607?v=4","gravatar_id":"","url":"https://api.github.com/users/kinggoesgaming","html_url":"https://github.com/kinggoesgaming","followers_url":"https://api.github.com/users/kinggoesgaming/followers","following_url":"https://api.github.com/users/kinggoesgaming/following{/other_user}","gists_url":"https://api.github.com/users/kinggoesgaming/gists{/gist_id}","starred_url":"https://api.github.com/users/kinggoesgaming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinggoesgaming/subscriptions","organizations_url":"https://api.github.com/users/kinggoesgaming/orgs","repos_url":"https://api.github.com/users/kinggoesgaming/repos","events_url":"https://api.github.com/users/kinggoesgaming/events{/privacy}","received_events_url":"https://api.github.com/users/kinggoesgaming/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/uuid-rs/uuid/pulls/351/commits","review_comments_url":"https://api.github.com/repos/uuid-rs/uuid/pulls/351/comments","review_comment_url":"https://api.github.com/repos/uuid-rs/uuid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uuid-rs/uuid/issues/351/comments","statuses_url":"https://api.github.com/repos/uuid-rs/uuid/statuses/0ccfd12fdef708d9253c9b9b9c0ece45727fd051","head":{"label":"zrzka:feature/wasm","ref":"feature/wasm","sha":"0ccfd12fdef708d9253c9b9b9c0ece45727fd051","user":{"login":"zrzka","id":1084172,"node_id":"MDQ6VXNlcjEwODQxNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/1084172?v=4","gravatar_id":"","url":"https://api.github.com/users/zrzka","html_url":"https://github.com/zrzka","followers_url":"https://api.github.com/users/zrzka/followers","following_url":"https://api.github.com/users/zrzka/following{/other_user}","gists_url":"https://api.github.com/users/zrzka/gists{/gist_id}","starred_url":"https://api.github.com/users/zrzka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zrzka/subscriptions","organizations_url":"https://api.github.com/users/zrzka/orgs","repos_url":"https://api.github.com/users/zrzka/repos","events_url":"https://api.github.com/users/zrzka/events{/privacy}","received_events_url":"https://api.github.com/users/zrzka/received_events","type":"User","site_admin":false},"repo":{"id":159291460,"node_id":"MDEwOlJlcG9zaXRvcnkxNTkyOTE0NjA=","name":"uuid","full_name":"zrzka/uuid","private":false,"owner":{"login":"zrzka","id":1084172,"node_id":"MDQ6VXNlcjEwODQxNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/1084172?v=4","gravatar_id":"","url":"https://api.github.com/users/zrzka","html_url":"https://github.com/zrzka","followers_url":"https://api.github.com/users/zrzka/followers","following_url":"https://api.github.com/users/zrzka/following{/other_user}","gists_url":"https://api.github.com/users/zrzka/gists{/gist_id}","starred_url":"https://api.github.com/users/zrzka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zrzka/subscriptions","organizations_url":"https://api.github.com/users/zrzka/orgs","repos_url":"https://api.github.com/users/zrzka/repos","events_url":"https://api.github.com/users/zrzka/events{/privacy}","received_events_url":"https://api.github.com/users/zrzka/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zrzka/uuid","description":"Generate and parse UUIDs.","fork":true,"url":"https://api.github.com/repos/zrzka/uuid","forks_url":"https://api.github.com/repos/zrzka/uuid/forks","keys_url":"https://api.github.com/repos/zrzka/uuid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zrzka/uuid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zrzka/uuid/teams","hooks_url":"https://api.github.com/repos/zrzka/uuid/hooks","issue_events_url":"https://api.github.com/repos/zrzka/uuid/issues/events{/number}","events_url":"https://api.github.com/repos/zrzka/uuid/events","assignees_url":"https://api.github.com/repos/zrzka/uuid/assignees{/user}","branches_url":"https://api.github.com/repos/zrzka/uuid/branches{/branch}","tags_url":"https://api.github.com/repos/zrzka/uuid/tags","blobs_url":"https://api.github.com/repos/zrzka/uuid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zrzka/uuid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zrzka/uuid/git/refs{/sha}","trees_url":"https://api.github.com/repos/zrzka/uuid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zrzka/uuid/statuses/{sha}","languages_url":"https://api.github.com/repos/zrzka/uuid/languages","stargazers_url":"https://api.github.com/repos/zrzka/uuid/stargazers","contributors_url":"https://api.github.com/repos/zrzka/uuid/contributors","subscribers_url":"https://api.github.com/repos/zrzka/uuid/subscribers","subscription_url":"https://api.github.com/repos/zrzka/uuid/subscription","commits_url":"https://api.github.com/repos/zrzka/uuid/commits{/sha}","git_commits_url":"https://api.github.com/repos/zrzka/uuid/git/commits{/sha}","comments_url":"https://api.github.com/repos/zrzka/uuid/comments{/number}","issue_comment_url":"https://api.github.com/repos/zrzka/uuid/issues/comments{/number}","contents_url":"https://api.github.com/repos/zrzka/uuid/contents/{+path}","compare_url":"https://api.github.com/repos/zrzka/uuid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zrzka/uuid/merges","archive_url":"https://api.github.com/repos/zrzka/uuid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zrzka/uuid/downloads","issues_url":"https://api.github.com/repos/zrzka/uuid/issues{/number}","pulls_url":"https://api.github.com/repos/zrzka/uuid/pulls{/number}","milestones_url":"https://api.github.com/repos/zrzka/uuid/milestones{/number}","notifications_url":"https://api.github.com/repos/zrzka/uuid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zrzka/uuid/labels{/name}","releases_url":"https://api.github.com/repos/zrzka/uuid/releases{/id}","deployments_url":"https://api.github.com/repos/zrzka/uuid/deployments","created_at":"2018-11-27T07:08:43Z","updated_at":"2018-11-27T07:08:45Z","pushed_at":"2018-11-27T11:57:51Z","git_url":"git://github.com/zrzka/uuid.git","ssh_url":"git@github.com:zrzka/uuid.git","clone_url":"https://github.com/zrzka/uuid.git","svn_url":"https://github.com/zrzka/uuid","homepage":"http://docs.rs/uuid","size":939,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"uuid-rs:master","ref":"master","sha":"f2e2463b0270f41dfcce3bc7f0dd036aec7aa103","user":{"login":"uuid-rs","id":35938770,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1OTM4Nzcw","avatar_url":"https://avatars2.githubusercontent.com/u/35938770?v=4","gravatar_id":"","url":"https://api.github.com/users/uuid-rs","html_url":"https://github.com/uuid-rs","followers_url":"https://api.github.com/users/uuid-rs/followers","following_url":"https://api.github.com/users/uuid-rs/following{/other_user}","gists_url":"https://api.github.com/users/uuid-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/uuid-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uuid-rs/subscriptions","organizations_url":"https://api.github.com/users/uuid-rs/orgs","repos_url":"https://api.github.com/users/uuid-rs/repos","events_url":"https://api.github.com/users/uuid-rs/events{/privacy}","received_events_url":"https://api.github.com/users/uuid-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":22446506,"node_id":"MDEwOlJlcG9zaXRvcnkyMjQ0NjUwNg==","name":"uuid","full_name":"uuid-rs/uuid","private":false,"owner":{"login":"uuid-rs","id":35938770,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1OTM4Nzcw","avatar_url":"https://avatars2.githubusercontent.com/u/35938770?v=4","gravatar_id":"","url":"https://api.github.com/users/uuid-rs","html_url":"https://github.com/uuid-rs","followers_url":"https://api.github.com/users/uuid-rs/followers","following_url":"https://api.github.com/users/uuid-rs/following{/other_user}","gists_url":"https://api.github.com/users/uuid-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/uuid-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uuid-rs/subscriptions","organizations_url":"https://api.github.com/users/uuid-rs/orgs","repos_url":"https://api.github.com/users/uuid-rs/repos","events_url":"https://api.github.com/users/uuid-rs/events{/privacy}","received_events_url":"https://api.github.com/users/uuid-rs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/uuid-rs/uuid","description":"Generate and parse UUIDs.","fork":false,"url":"https://api.github.com/repos/uuid-rs/uuid","forks_url":"https://api.github.com/repos/uuid-rs/uuid/forks","keys_url":"https://api.github.com/repos/uuid-rs/uuid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uuid-rs/uuid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uuid-rs/uuid/teams","hooks_url":"https://api.github.com/repos/uuid-rs/uuid/hooks","issue_events_url":"https://api.github.com/repos/uuid-rs/uuid/issues/events{/number}","events_url":"https://api.github.com/repos/uuid-rs/uuid/events","assignees_url":"https://api.github.com/repos/uuid-rs/uuid/assignees{/user}","branches_url":"https://api.github.com/repos/uuid-rs/uuid/branches{/branch}","tags_url":"https://api.github.com/repos/uuid-rs/uuid/tags","blobs_url":"https://api.github.com/repos/uuid-rs/uuid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uuid-rs/uuid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uuid-rs/uuid/git/refs{/sha}","trees_url":"https://api.github.com/repos/uuid-rs/uuid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uuid-rs/uuid/statuses/{sha}","languages_url":"https://api.github.com/repos/uuid-rs/uuid/languages","stargazers_url":"https://api.github.com/repos/uuid-rs/uuid/stargazers","contributors_url":"https://api.github.com/repos/uuid-rs/uuid/contributors","subscribers_url":"https://api.github.com/repos/uuid-rs/uuid/subscribers","subscription_url":"https://api.github.com/repos/uuid-rs/uuid/subscription","commits_url":"https://api.github.com/repos/uuid-rs/uuid/commits{/sha}","git_commits_url":"https://api.github.com/repos/uuid-rs/uuid/git/commits{/sha}","comments_url":"https://api.github.com/repos/uuid-rs/uuid/comments{/number}","issue_comment_url":"https://api.github.com/repos/uuid-rs/uuid/issues/comments{/number}","contents_url":"https://api.github.com/repos/uuid-rs/uuid/contents/{+path}","compare_url":"https://api.github.com/repos/uuid-rs/uuid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uuid-rs/uuid/merges","archive_url":"https://api.github.com/repos/uuid-rs/uuid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uuid-rs/uuid/downloads","issues_url":"https://api.github.com/repos/uuid-rs/uuid/issues{/number}","pulls_url":"https://api.github.com/repos/uuid-rs/uuid/pulls{/number}","milestones_url":"https://api.github.com/repos/uuid-rs/uuid/milestones{/number}","notifications_url":"https://api.github.com/repos/uuid-rs/uuid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uuid-rs/uuid/labels{/name}","releases_url":"https://api.github.com/repos/uuid-rs/uuid/releases{/id}","deployments_url":"https://api.github.com/repos/uuid-rs/uuid/deployments","created_at":"2014-07-30T22:03:55Z","updated_at":"2018-11-21T10:13:21Z","pushed_at":"2018-11-27T11:57:53Z","git_url":"git://github.com/uuid-rs/uuid.git","ssh_url":"git@github.com:uuid-rs/uuid.git","clone_url":"https://github.com/uuid-rs/uuid.git","svn_url":"https://github.com/uuid-rs/uuid","homepage":"http://docs.rs/uuid","size":934,"stargazers_count":209,"watchers_count":209,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":80,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":80,"open_issues":24,"watchers":209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uuid-rs/uuid/pulls/351"},"html":{"href":"https://github.com/uuid-rs/uuid/pull/351"},"issue":{"href":"https://api.github.com/repos/uuid-rs/uuid/issues/351"},"comments":{"href":"https://api.github.com/repos/uuid-rs/uuid/issues/351/comments"},"review_comments":{"href":"https://api.github.com/repos/uuid-rs/uuid/pulls/351/comments"},"review_comment":{"href":"https://api.github.com/repos/uuid-rs/uuid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uuid-rs/uuid/pulls/351/commits"},"statuses":{"href":"https://api.github.com/repos/uuid-rs/uuid/statuses/0ccfd12fdef708d9253c9b9b9c0ece45727fd051"}},"author_association":"NONE"}}
{"actor":{"display_login":"Dylan-DPC"}}