{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/787","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/787/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/787/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/787/events","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/787","id":46310234,"number":787,"title":"when mapbox-gl-js is included in a browserify bundle, the web worker runs the entire bundle","user":{"login":"jfirebaugh","id":98601,"avatar_url":"https://avatars.githubusercontent.com/u/98601?v=3","gravatar_id":"","url":"https://api.github.com/users/jfirebaugh","html_url":"https://github.com/jfirebaugh","followers_url":"https://api.github.com/users/jfirebaugh/followers","following_url":"https://api.github.com/users/jfirebaugh/following{/other_user}","gists_url":"https://api.github.com/users/jfirebaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/jfirebaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfirebaugh/subscriptions","organizations_url":"https://api.github.com/users/jfirebaugh/orgs","repos_url":"https://api.github.com/users/jfirebaugh/repos","events_url":"https://api.github.com/users/jfirebaugh/events{/privacy}","received_events_url":"https://api.github.com/users/jfirebaugh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-10-20T18:39:57Z","updated_at":"2015-05-24T07:00:42Z","closed_at":null,"body":"Potential fix: https://github.com/shama/workerify\r\n\r\nHowever, as far as I can tell this would lead to duplicating code that's shared between the worker and the main library (it will appear once as normal browserified source and once embedded in the worker blob string). Commenting out the worker line from mapbox-gl.js and running a command to see the overlap:\r\n\r\n```\r\n~/Development/mapbox-gl-js $ comm -12 <(node_modules/.bin/browserify --list js/source/worker.js | sort) <(node_modules/.bin/browserify --list js/mapbox-gl.js | sort)\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/buffer_set.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/fill_elements_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/fill_vertex_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/glyph_vertex_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/icon_vertex_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/line_element_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/line_vertex_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/buffer/outline_elements_buffer.js\r\n/Users/john/Development/mapbox-gl-js/js/data/create_bucket.js\r\n/Users/john/Development/mapbox-gl-js/js/data/element_groups.js\r\n/Users/john/Development/mapbox-gl-js/js/data/fill_bucket.js\r\n/Users/john/Development/mapbox-gl-js/js/data/line_bucket.js\r\n/Users/john/Development/mapbox-gl-js/js/data/raster_bucket.js\r\n/Users/john/Development/mapbox-gl-js/js/data/symbol_bucket.js\r\n/Users/john/Development/mapbox-gl-js/js/geo/lat_lng.js\r\n/Users/john/Development/mapbox-gl-js/js/geo/transform.js\r\n/Users/john/Development/mapbox-gl-js/js/source/tile_coord.js\r\n/Users/john/Development/mapbox-gl-js/js/style/reference.js\r\n/Users/john/Development/mapbox-gl-js/js/style/render_properties.js\r\n/Users/john/Development/mapbox-gl-js/js/symbol/anchor.js\r\n/Users/john/Development/mapbox-gl-js/js/symbol/interpolate.js\r\n/Users/john/Development/mapbox-gl-js/js/symbol/placement.js\r\n/Users/john/Development/mapbox-gl-js/js/symbol/resolve_text.js\r\n/Users/john/Development/mapbox-gl-js/js/symbol/shaping.js\r\n/Users/john/Development/mapbox-gl-js/js/util/actor.js\r\n/Users/john/Development/mapbox-gl-js/js/util/browser/ajax.js\r\n/Users/john/Development/mapbox-gl-js/js/util/token.js\r\n/Users/john/Development/mapbox-gl-js/js/util/util.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/browserify/node_modules/buffer/index.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/browserify/node_modules/buffer/node_modules/base64-js/lib/b64.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/browserify/node_modules/buffer/node_modules/ieee754/index.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/browserify/node_modules/buffer/node_modules/is-array/index.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/mapbox-gl-style-spec/reference/v5.json\r\n/Users/john/Development/mapbox-gl-js/node_modules/pbf/index.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/pbf/node_modules/ieee754/index.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/point-geometry/index.js\r\n/Users/john/Development/mapbox-gl-js/node_modules/unitbezier/index.js\r\n```"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments/104985219","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/787#issuecomment-104985219","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/787","id":104985219,"user":{"login":"vicapow","id":583385,"avatar_url":"https://avatars.githubusercontent.com/u/583385?v=3","gravatar_id":"","url":"https://api.github.com/users/vicapow","html_url":"https://github.com/vicapow","followers_url":"https://api.github.com/users/vicapow/followers","following_url":"https://api.github.com/users/vicapow/following{/other_user}","gists_url":"https://api.github.com/users/vicapow/gists{/gist_id}","starred_url":"https://api.github.com/users/vicapow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicapow/subscriptions","organizations_url":"https://api.github.com/users/vicapow/orgs","repos_url":"https://api.github.com/users/vicapow/repos","events_url":"https://api.github.com/users/vicapow/events{/privacy}","received_events_url":"https://api.github.com/users/vicapow/received_events","type":"User","site_admin":false},"created_at":"2015-05-24T07:00:42Z","updated_at":"2015-05-24T07:00:42Z","body":"Without browserify, it makes it difficult to create useable components on top of mapboxGL. Instead of saying \"Hey, to use this component just npm install my-special-mapbox-gl-react-component\". There's an additional step of including the mapbox-gl in a separate script tag."}}