{"action":"created","issue":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/839","repository_url":"https://api.github.com/repos/WebAudio/web-audio-api","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/839/labels{/name}","comments_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/839/comments","events_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/839/events","html_url":"https://github.com/WebAudio/web-audio-api/issues/839","id":159532386,"number":839,"title":"AudioWorklet string name collisions","user":{"login":"cwilso","id":507001,"avatar_url":"https://avatars.githubusercontent.com/u/507001?v=3","gravatar_id":"","url":"https://api.github.com/users/cwilso","html_url":"https://github.com/cwilso","followers_url":"https://api.github.com/users/cwilso/followers","following_url":"https://api.github.com/users/cwilso/following{/other_user}","gists_url":"https://api.github.com/users/cwilso/gists{/gist_id}","starred_url":"https://api.github.com/users/cwilso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwilso/subscriptions","organizations_url":"https://api.github.com/users/cwilso/orgs","repos_url":"https://api.github.com/users/cwilso/repos","events_url":"https://api.github.com/users/cwilso/events{/privacy}","received_events_url":"https://api.github.com/users/cwilso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WebAudio/web-audio-api/labels/Clarification%20(Requires%20change)","name":"Clarification (Requires change)","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/milestones/1","html_url":"https://github.com/WebAudio/web-audio-api/milestones/Web%20Audio%20V1","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/milestones/1/labels","id":444685,"number":1,"title":"Web Audio V1","description":"Issues to be resolved to enable V1 to be taken forward.","creator":{"login":"olivierthereaux","id":604646,"avatar_url":"https://avatars.githubusercontent.com/u/604646?v=3","gravatar_id":"","url":"https://api.github.com/users/olivierthereaux","html_url":"https://github.com/olivierthereaux","followers_url":"https://api.github.com/users/olivierthereaux/followers","following_url":"https://api.github.com/users/olivierthereaux/following{/other_user}","gists_url":"https://api.github.com/users/olivierthereaux/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierthereaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierthereaux/subscriptions","organizations_url":"https://api.github.com/users/olivierthereaux/orgs","repos_url":"https://api.github.com/users/olivierthereaux/repos","events_url":"https://api.github.com/users/olivierthereaux/events{/privacy}","received_events_url":"https://api.github.com/users/olivierthereaux/received_events","type":"User","site_admin":false},"open_issues":65,"closed_issues":161,"state":"open","created_at":"2013-10-03T15:27:25Z","updated_at":"2016-06-09T23:42:21Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-06-09T23:42:21Z","updated_at":"2016-06-10T21:21:45Z","closed_at":null,"body":"From an IM chat with @hoch:\r\n\r\nI'm really worried about the registration and reference of AudioWorklets being purely a string reference name.  Seems like to cause a lot of conflicts, as devs build apps that include multiple Worklet libraries.  It seems like we should give an optional prepend label to the \"import\" call, or resolving the import() with some form of factory to create Processors from just that Worklet library.\r\n\r\nThe use case, for example, is if I (an app author) want to use and compare two different custom node libraries, both of which define a \"BitCrusher\"), and do an A/B test.  With the current design, if both vendors happen to name their node \"BitCrusher\", I can't ever do this - because I'm not in control of what string token they put inside their library.\r\n\r\n@hoch said \"This is how Worklet infrastructure works, so I didn't want to diverge from there.\"  That just means now I'm concerned about other Worklet cases, too, because this seems like it doesn't scale well. (cc @bfgeek)\r\n\r\n@hoch said \"But we have same problems like this with npm or bower. They operate the whole system based on a string.\" - but my response is that npm and bower have - by design - a global registry.  This forcibly eliminates name conflicts up front.  The problem isn't that there's a string token, per se - it's that the registry isn't globally organized (like npm or bower), and simple string tokens are most likely.  \r\n\r\nTo fix this, I can see a couple of options - optionally supply a string prepend to the token  (e.g. window.audioWorklet.import('bitcrusher.js', \"vendor1\").then())\r\nand access via new AudioWorkletNode(context, \"vendor1BitCrusher\")  (the label could be optional, of course, in which case it looks just like current design.\r\n\r\nor, have the audioworklet.import return a factory for nodes, or a token you pass in to the AudioWorkletNode creator.\r\n\r\nRegardless, should try to rationalize against general pattern of Worklets."},"comment":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/comments/225298909","html_url":"https://github.com/WebAudio/web-audio-api/issues/839#issuecomment-225298909","issue_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/839","id":225298909,"user":{"login":"cwilso","id":507001,"avatar_url":"https://avatars.githubusercontent.com/u/507001?v=3","gravatar_id":"","url":"https://api.github.com/users/cwilso","html_url":"https://github.com/cwilso","followers_url":"https://api.github.com/users/cwilso/followers","following_url":"https://api.github.com/users/cwilso/following{/other_user}","gists_url":"https://api.github.com/users/cwilso/gists{/gist_id}","starred_url":"https://api.github.com/users/cwilso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwilso/subscriptions","organizations_url":"https://api.github.com/users/cwilso/orgs","repos_url":"https://api.github.com/users/cwilso/repos","events_url":"https://api.github.com/users/cwilso/events{/privacy}","received_events_url":"https://api.github.com/users/cwilso/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T21:21:45Z","updated_at":"2016-06-10T21:21:45Z","body":"But these aren't the same in usage.  The closest one is custom elements;\nand the original design did, IIRC, enable you to work around this potential\nproblem.  (I think you might have this problem now.) But custom elements\nhave that restriction in order to future-proof the HTML namespace (i.e. you\ncouldn't have a popular library take over the tagname \"circle\" and prevent\nHTML 6.3 from adding an element named \"circle\").\n\nCSS variables and CustomEvents are likewise much less likely to have\nconflicting objects defined by multiple libraries both intended to be used\nin a single application.\n\nIt just seems super-likely that eventually audio apps will want to plug in\nmultiple libraries of custom nodes, and offer users a choice between\nsimilar nodes. \"Use a complex name\" seems like less than ideal guidance.\nIt would seem easy enough to return a factory or token from import() that\nwas specific to this library.\n\n\nOn Fri, Jun 10, 2016 at 11:22 AM, Ian Kilpatrick <notifications@github.com>\nwrote:\n\n> Custom elements actually have this restriction so that the platform can\n> add native html elements later without fear of breaking sites. I.e.\n> <circle> <!-- Illegal as no '-' -->\n>\n> I wouldn't worry about this and just educate libraries to prefix their\n> custom nodes.\n>\n> This is pretty common on the platform today with:\n>\n>    - Custom elements (as mentioned)\n>    - CSS Variables (--width, no restriction apart from leading --, again\n>    just to prevent future native properties)\n>    - Custom events, (new CustomEvent('action'); no restriction)\n>    - Element attributes (all are fair game I believe; people are\n>    encouraged to use data- prefixed ones, again so that platform can add\n>    later) ... etc.\n>\n> If you are particularly worried about this the suggestion from @hoch\n> <https://github.com/hoch> seems good, just require a '-' in the name to\n> encourage prefixing.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/WebAudio/web-audio-api/issues/839#issuecomment-225258213>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe/AAe8eU8BENlUVcXq4q1OTzNqXKuqgkYqks5qKatVgaJpZM4Iyggx>\n> .\n>\n"}}
{"actor":{"display_login":"cwilso"}}