logo

NJP

Announcing ServiceNow SDK 2.2.6 is available!

New article articles in ServiceNow Community · Feb 08, 2025 · article

We are excited to announce that release 2.2.6 of the ServiceNow SDK is available on npm!

With this release we have squashed some bugs added a few utilities to make development with large strings better!

Fixes:

  • Delete records for `sys_db_object` are causing errors during fetch
  • Duplicate List calls are generated when lists have parents references
  • Fix situation where the default sys ui view could be deleted

Changes to fetch and convert behavior!

In previous versions of the SDK, the fetch and convert commands would convert all application metadata files into the equivalent fluent (now.ts) representation. We recognize that for existing applications many users would rather convert code to fluent (now.ts) code piece by piece in order to have more control over how their app is changing, and reduce the amount of changes happening all at once.

The default behavior of 'fetch' and 'convert' commands have changed to not generate fluent code for existing application metadata by default, and instead leave these files as xml in the `metadata` folder. The xml files in metadata folder are the exact files that the instance is exporting, so there is no change to the application at the start of fluent development. During build and deploy the xml metadata files will be included in the application package along with any fluent code. If a piece of metadata has a representation in fluent and in xml, the xml representation will take precedence.

Files downloaded from the instance during fetch will respect the metadata folder and update the xml representation of the record instead of generating fluent code. If the record has no xml representation in the local metadata folder, fetch will generate it as new fluent code or update the corresponding existing fluent code.

If you wish to transition an existing app to fluent, you now have the option to scaffold the app as a fluent project and leave the records as xml in the metadata folder . This allows for iterative development and conversion into fluent on a record-by-record basis, so that applications can be converted over without potentially changing behavior all at once. The transform command is available if you wish to convert individual pieces of metadata over into fluent during your conversion or development cycle.

New 'Now.include' API!

Added Now.include('file-path') utility for referencing content from a file and setting it on a field for any fluent API. This helpful utility function can be used when you would like to move field contents into a file that make editing and development easier, and get proper syntax highlighting or other editor features for a file extension.

For example, you can use this to move javascript content into js files or html content into .html files and so on.

Example:

Record({ $id: Now.ID['sys-script-1'], table: 'sys_script_include', data: { script: Now.include('./myscriptinclude.js') } }) Record({ $id: Now.ID['sys-ui-page-1'], table: 'sys_ui_page', data: { html: Now.include('./page.html'), script: Now.include('./script.js'), css: Now.include('./css.css') } })

Note: With this release this is currently a one-way operation for build only, and file contents are not updated on fetch if the content changes on the server. In the future 3.0 release (coming soon) this will support updates from the instance into the file during fetch.

View original source

https://www.servicenow.com/community/servicenow-ide-sdk-and-fluent/announcing-servicenow-sdk-2-2-6-is-available/ta-p/3169490