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

5monkeys / django-bananas.js / 139 / 1
87%
master: 87%

Build:
DEFAULT BRANCH: master
Ran 30 Apr 2019 03:50PM UTC
Files 56
Run time 3s
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

30 Apr 2019 03:49PM UTC coverage: 87.269%. Remained the same
139.1

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

Source Files on job 139.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 86
  • Travis Job 139.1
  • e2486ba0 on github
  • Prev Job for on master (#135.1)
  • Next Job for on master (#141.1)
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