{"action":"created","issue":{"url":"https://api.github.com/repos/ripple/ripple-lib/issues/367","labels_url":"https://api.github.com/repos/ripple/ripple-lib/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/ripple/ripple-lib/issues/367/comments","events_url":"https://api.github.com/repos/ripple/ripple-lib/issues/367/events","html_url":"https://github.com/ripple/ripple-lib/issues/367","id":87650542,"number":367,"title":"dist/npm missing schemas (and other babel compile woes)","user":{"login":"sublimator","id":525211,"avatar_url":"https://avatars.githubusercontent.com/u/525211?v=3","gravatar_id":"","url":"https://api.github.com/users/sublimator","html_url":"https://github.com/sublimator","followers_url":"https://api.github.com/users/sublimator/followers","following_url":"https://api.github.com/users/sublimator/following{/other_user}","gists_url":"https://api.github.com/users/sublimator/gists{/gist_id}","starred_url":"https://api.github.com/users/sublimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sublimator/subscriptions","organizations_url":"https://api.github.com/users/sublimator/orgs","repos_url":"https://api.github.com/users/sublimator/repos","events_url":"https://api.github.com/users/sublimator/events{/privacy}","received_events_url":"https://api.github.com/users/sublimator/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-12T08:11:12Z","updated_at":"2015-06-12T23:45:22Z","closed_at":"2015-06-12T23:45:22Z","body":"Few issues:\r\n* es6 runtime patches (like String.prototype.endsWith) seem to be missing\r\n* npm compile before each script run is slow\r\n\r\nWhen you try to run `npm run-script perf` it errors, when it can't find the `schemas/` folder. On top of that, if it's there (I sym linked it), there's another error due to a missing endsWith function. I looked that up, and it's apparently a String method only added in ES6.\r\n\r\nIt's also quite painful having to wait for the `npm run-script compile` each time (On my machine it takes about 5 seconds) and the logs are noisy. Apparently you can use `babel-node` which seems to do on the fly compiling (and String.endsWith seems available) in what feels like around a second.\r\n\r\nYou of course need to update the scripts from:\r\n```javascript\r\nvar Amount = require('../dist/npm').Amount;\r\n```\r\nto:\r\n```javascript\r\nvar Amount = require('../src').Amount;\r\n```\r\n\r\nI'm guessing there's probably other ES6 issues with the missing runtime?\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/21650468-dist-npm-missing-schemas-and-other-babel-compile-woes?utm_campaign=plugin&utm_content=tracker%2F323756&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F323756&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/ripple/ripple-lib/issues/comments/111642692","html_url":"https://github.com/ripple/ripple-lib/issues/367#issuecomment-111642692","issue_url":"https://api.github.com/repos/ripple/ripple-lib/issues/367","id":111642692,"user":{"login":"clark800","id":1238722,"avatar_url":"https://avatars.githubusercontent.com/u/1238722?v=3","gravatar_id":"","url":"https://api.github.com/users/clark800","html_url":"https://github.com/clark800","followers_url":"https://api.github.com/users/clark800/followers","following_url":"https://api.github.com/users/clark800/following{/other_user}","gists_url":"https://api.github.com/users/clark800/gists{/gist_id}","starred_url":"https://api.github.com/users/clark800/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clark800/subscriptions","organizations_url":"https://api.github.com/users/clark800/orgs","repos_url":"https://api.github.com/users/clark800/repos","events_url":"https://api.github.com/users/clark800/events{/privacy}","received_events_url":"https://api.github.com/users/clark800/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T23:45:22Z","updated_at":"2015-06-12T23:45:22Z","body":"So I just learned that babel doesn't transpile all es6 features in `runtime` mode unless you additionally require the polyfill. This seems to contradict the documentation, so I filed an issue with Babel on GitHub. In the meantime, I just wrote a function for `endsWith` and fixed the perf test in this pull request: https://github.com/ripple/ripple-lib/pull/370\r\n\r\nWe can't use babel-node or the babel require hook for production because we have to support users who are running es5 without babel. But npm test currently does run with the require hook. That's something that we should probably change because we aren't exactly testing the production code.\r\n\r\nI haven't figured out how to use caching yet, but that would be a good way to speed it up. I added the following JIRA tasks: https://ripplelabs.atlassian.net/browse/RLJS-386, https://ripplelabs.atlassian.net/browse/RLJS-387\r\n"}}