{"action":"created","issue":{"url":"https://api.github.com/repos/andyearnshaw/Intl.js/issues/118","labels_url":"https://api.github.com/repos/andyearnshaw/Intl.js/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/andyearnshaw/Intl.js/issues/118/comments","events_url":"https://api.github.com/repos/andyearnshaw/Intl.js/issues/118/events","html_url":"https://github.com/andyearnshaw/Intl.js/issues/118","id":93215730,"number":118,"title":"Correct way to polyfill v1.0 in the browser (webpack)","user":{"login":"gpbl","id":120693,"avatar_url":"https://avatars.githubusercontent.com/u/120693?v=3","gravatar_id":"","url":"https://api.github.com/users/gpbl","html_url":"https://github.com/gpbl","followers_url":"https://api.github.com/users/gpbl/followers","following_url":"https://api.github.com/users/gpbl/following{/other_user}","gists_url":"https://api.github.com/users/gpbl/gists{/gist_id}","starred_url":"https://api.github.com/users/gpbl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpbl/subscriptions","organizations_url":"https://api.github.com/users/gpbl/orgs","repos_url":"https://api.github.com/users/gpbl/repos","events_url":"https://api.github.com/users/gpbl/events{/privacy}","received_events_url":"https://api.github.com/users/gpbl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-06T07:53:31Z","updated_at":"2015-07-09T07:09:50Z","closed_at":null,"body":"I've got my code working with v1.0 rc4 :tada: yet I'm not sure why it works. My goal is to require the polyfill using webpack's code splitting, loading the locale-data after Intl has been polyfilled – e.g. in Safari. \r\n\r\nBefore v1.0 [I was doing](https://github.com/gpbl/isomorphic500/blob/master/src/utils/IntlUtils.js#L34-L37):\r\n\r\n```js\r\nconst IntlPolyfill = require(\"intl/Intl\");\r\nconsole.log(Intl) // OK!\r\nIntl.NumberFormat = IntlPolyfill.NumberFormat;\r\nIntl.DateTimeFormat = IntlPolyfill.DateTimeFormat;\r\n\r\n// later, load and add the locale data\r\nrequire(\"intl/locale-data/jsonp/it\");\r\n```\r\n\r\nNow I see the package to load has been moved in `intl/dist/Intl`. However just requiring it does not add a `Intl` global:\r\n\r\n```js\r\nconst IntlPolyfill = require(\"intl/dist/Intl\");\r\nconsole.log(Intl) // undefined\r\nIntl.NumberFormat = IntlPolyfill.NumberFormat; // error!\r\n```\r\n\r\nLooking to the objects exported from `dist/Intl` i see `Intl` and `IntlPolyfill`. So I wrote the following, but loading the locale-data throws a `IntlPolyfill is not defined`:\r\n\r\n```js\r\nwindow.Intl = require(\"intl/dist/Intl\").Intl;\r\n\r\n// later, load and add the locale data\r\nrequire(\"intl/locale-data/jsonp/it\"); // Error: IntlPolyfill is not defined\r\n```\r\n\r\nInstead, everything works fine when I do:\r\n\r\n```js\r\nwindow.Intl = require(\"intl/dist/Intl\").Intl;\r\nwindow.IntlPolyfill = require(\"intl/dist/Intl\").IntlPolyfill;\r\n\r\nrequire(\"intl/locale-data/jsonp/it\");\r\n```\r\n\r\nI'm using it right? What is the difference between the exported `IntlPolyfill` and `Intl`? Why is locale-data requiring `IntlPolyfill` (I was expecting it augmenting `Intl`)? I looked into the issues and PRs but couldn't find any help.\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/andyearnshaw/Intl.js/issues/comments/119850647","html_url":"https://github.com/andyearnshaw/Intl.js/issues/118#issuecomment-119850647","issue_url":"https://api.github.com/repos/andyearnshaw/Intl.js/issues/118","id":119850647,"user":{"login":"gpbl","id":120693,"avatar_url":"https://avatars.githubusercontent.com/u/120693?v=3","gravatar_id":"","url":"https://api.github.com/users/gpbl","html_url":"https://github.com/gpbl","followers_url":"https://api.github.com/users/gpbl/followers","following_url":"https://api.github.com/users/gpbl/following{/other_user}","gists_url":"https://api.github.com/users/gpbl/gists{/gist_id}","starred_url":"https://api.github.com/users/gpbl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpbl/subscriptions","organizations_url":"https://api.github.com/users/gpbl/orgs","repos_url":"https://api.github.com/users/gpbl/repos","events_url":"https://api.github.com/users/gpbl/events{/privacy}","received_events_url":"https://api.github.com/users/gpbl/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T07:09:50Z","updated_at":"2015-07-09T07:09:50Z","body":"great thanks! however I'm not sure yet how `polyfill-service` would help with webpack's code splitting :) "}}