• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

5monkeys / django-bananas.js / 139
87%

Build:
DEFAULT BRANCH: master
Ran 30 Apr 2019 03:50PM UTC
Jobs 1
Files 56
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
139

push

travis-ci-com

web-flow
Ship modern JS to npm (#11)

Previously we transpiled down to IE11 and other older browsers, but we
hadn’t set up babel polyfills. Most notably, this meant that the
compiled code referenced a `regeneratorRuntime` variable that wasn’t
defined (it’s supposed to be defined globally through babel polyfills).
In projects using Create React App we hadn’t noticed this, because CRA
runs npm package code through babel, injecting `regeneratorRuntime`.

However, when trying to use django-bananas in Next.js, the undeclared
`regeneratorRuntime`s threw errors. So what to do?

We _could_ include polyfills in django-bananas. But it might be
unexpected that using django-bananas modifies global objects. And both
we and the user of django-bananas might try to assign
`window.regeneratorRuntime` to different versions.

Another way would be to configure babel to use non-global-polluting
polyfills. But that would make the package unnecessarily heavy
considering that many times admins are used in modern browsers only.

This commit changes the babel setup to use the "esmodules" target, which
targets browsers supporting ES Modules. In other words – the evergreen
browsers. This means that `async`/`await` is preserved – no more
`regeneratorRuntime`. It is then up to the user of django-bananas to
transpile further and add polyfills if deeper browser support is wanted.
Create React App is an example of a build pipeline that supports
transforming code from npm packages.

`import`/`export` are still transpiled to `require`/`module.exports` to
support Next.js server side rendering.

546 of 703 branches covered (77.67%)

Branch coverage included in aggregate %.

921 of 978 relevant lines covered (94.17%)

54.77 hits per line

Jobs
ID Job ID Ran Files Coverage
1 139.1 30 Apr 2019 03:50PM UTC 0
87.27
Travis Job 139.1
Source Files on build 139
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #139
  • e2486ba0 on github
  • Prev Build on master (#135)
  • Next Build on master (#141)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc