
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@syncrona/babel-plugin
Advanced tools
SyncroNow AI build plugin that runs Babel on JavaScript/TypeScript files, enabling modern syntax in ServiceNow (Rhino) scoped-app code.
SyncroNow AI is the ServiceNow scoped-application toolchain behind the syncrona CLI. This package is one of its build plugins: register it in the rules array of your sync.config.js and syncrona build runs it over every matching file.
This plugin allows you to run Babel on your javascript and TypeScript files. This enables you to do all kinds of interesting things with your code structure. It also lets you use more modern javascript features in your ServiceNow development.
Whatever Babel plugins and presets you use, you still need to npm install them like usual.
npm i -D @syncrona/babel-plugin
This plugin takes the exact same options as .babelrc.
Although normal Babel transpilation enables nearly all modern javascript features in older javascript runtimes, ServiceNow's Rhino engine prevents certain modern features from working after transpilation.
Syntactic sugar such as ES6 classes, destructuring, let/const, template strings, default parameters, and arrow functions are supported. Features added to base classes like Array or for-of loops, Map, Set, and Weakmap are not supported because the prototype of base classes are locked in the Servicenow javascript engine.
A good rule of thumb is to not use the useBuiltIns option of the babel-preset-env preset. If your code works, then you are fine. If it throws errors when you run it, you most likely need an unsupported polyfill.
Feel free to riot so we can get more modern javascript features in ServiceNow 😉
This example takes .ts files and transpiles it to valid ServiceNow javascript.
//sync.config.js
module.exports={
rules:{
match:/\.ts$/,
plugins:[
name:"@syncrona/babel-plugin",
//Babel options. Numbering shows order of execution
options:{
presets: [
//6. Sanitize output code for ServiceNow
"@syncrona/servicenow",
//5. Babel env preset, transforms syntactic sugar to valid older javascript
"@babel/env",
//4. Typescript preset. Removes type information and makes it valid javascript
"@babel/typescript"
],
plugins: [
//1. Remove import/export statements used for type inference
"@syncrona/remove-modules",
//2 and 3. Required babel plugins for typescript
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
]
}
]
}
};
FAQs
SyncroNow AI build plugin that runs Babel on JavaScript/TypeScript files, enabling modern syntax in ServiceNow (Rhino) scoped-app code.
The npm package @syncrona/babel-plugin receives a total of 1 weekly downloads. As such, @syncrona/babel-plugin popularity was classified as not popular.
We found that @syncrona/babel-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.