Polyfills in Jira
When developing your app for Jira, you can freely use the EcmaScript language features and Browser runtime features described below, without the need for providing your own runtime polyfills.
We're bringing these changes in Jira 8.2, both to improve the Jira platform's front-end and to reduce the amount of additional code coming from apps that are used with Jira. We recommend that you use these features instead of providing your own polyfills.
Client-side APIs
As of Jira 8.2, we'll be supporting the following APIs in all browsers supported by Jira:
From EcmaScript 2015:
- Array static methods (e.g.
Array.from
) - Array prototype methods (e.g.
[].find
,[].keys
,[].values
,[].entries
) - Map
- Math methods (e.g.
Math.sign
,Math.trunc
) - Number methods (e.g.
Number.isFinite
) - Object static methods (e.g.
Object.assign
) - Promise
- Regular expression properties (e.g.
/.../.flags
) - Reflect
- Set
- String static methods
- String prototype methods
- Symbol
- WeakMap
- WeakSet
From EcmaScript 2016:
- Array prototype methods (e.g.
[].includes
)
From EcmaScript 2017:
- Object static methods
- String prototype methods
From EcmaScript 2018:
- Promise.prototype.finally
From WhatWG:
Recommendations for app developers
A recommended setup is to transpile JavaScript through Babel, at minimum version 7.
When building for products that fully support this level of the platform:
- Remove usage of
babel-preset-env
- Remove usage of
babel-runtime
andbabel-polyfill
- Remove any EcmaScript language feature polyfills provided by your app
- Transpile
typeof
checks for new built-ins (because e.g.typeof Symbol === 'symbol'
will not work)
Update your linting rules:
- The following should be errors, as they would require native browser support for the new polyfilled primitives:
- Use of
Object(Symbol)
- Use of
with
- Use of
Proxy
- Use of
- The following should be warnings because they will not work as expected with native built-ins, but will with polyfilled ones:
- Use of
Reflect.construct
- Use of
Symbol.species
,Symbol.hasInstance
,Symbol.toPrimitive
, andSymbol.unscopables
- Use of
<instance>.constructor
- Use of
Object.getOwnPropertyDescriptors
- Use of
Warnings for app developers
We recommend app developers stick to features natively supported in Jira Server’s supported browsers. When transpilers are used, we recommend only using features that require no browser runtime polyfills to support.
App developers that stray beyond these recommendations do so at their own risk.
What to look our for
Be cautious of your use of language features that require additional polyfills. Other app developers may have provided them already, which can cause problems for your app.
Some polyfills will break when included in the runtime environment multiple times.
You should only use polyfills which can be isolated to your own codepaths.
Polyfills that cannot be isolated to your own codepaths must not be used.
Type coersion between polyfilled primitives may not work as expected, and should be avoided.
Jira does not provide regenerator-runtime. If you make use of async functions, you should bundle and scope regenerator-runtime within your own app code and avoid affecting the global environment.
Polyfills matrix in Jira
Here you can find some details about polyfills shipped in different Jira versions.
Jira version | Polyfills |
---|---|
8.2 |
|
8.1, 8.0, 7.13, 7.12 |
|