SuiteScript 2.1: Compatible Build-Time and Runtime Libraries

April 29, 2024 | 9 minute read
Mohammed Kassem
SuiteCloud Advocate
Text Size 100%:

For developers working within the SuiteScript environment, it is most efficient to start with a curated list of known compatible third-party libraries. These libraries have been tested and verified to work seamlessly within the SuiteScript ecosystem, ensuring that developers can integrate them into their projects with confidence. By choosing from a vetted selection, developers can save time, reduce the potential for integration issues, and ensure that the software they build is as reliable and efficient as possible.

Build-Time Compatible Libraries (devDependencies)

Build-time libraries, also known as development dependencies, are instrumental during the software development phase. These libraries are not included in the final production code but are essential for various pre-deployment tasks, aiding developers to compile, optimize, and package their SuiteCloud projects effectively.

Think of build-time libraries as your comprehensive developer toolkit, enabling a range of functions:

  • Minification: To enhance project size and performance, build-time libraries can minify your code. This process eliminates redundant characters and formatting, thereby reducing file size and improving load times without altering functionality. Examples of such libraries include Webpack, gulp-uglify, and ESBuild.
  • Dependency Management: Handling a multitude of dependencies in a project can be daunting. Package managers like npm can automate the process of installing, managing, and versioning required libraries to streamline the build process, thus ensuring a more efficient deployment.
  • Transpilation: For projects utilizing advanced JavaScript features that the runtime environment does not natively support, build-time libraries such as @babel/core are capable of transpiling the syntax into a version compatible with the target environment, enabling flawless execution.

Note: SuiteScript 2.1 supports the latest JavaScript features natively. However, should you opt to use TypeScript for its static typing and other advanced features, transpilation will be necessary to convert TypeScript into plain JavaScript syntax for execution.

Here are some benefits of using build-time compatible libraries:

  • Reduce runtime errors and improve the overall reliability of your project.
  • Reduce time spent troubleshooting integration problems.
  • Automate unit tests for specific parts of your SuiteScript functionality.

Here’s a list of build-time compatible libraries that specifically work with SuiteCloud projects:

Built for NS

Library

Description

Category

Yes

@oracle/suitecloud-unit-testing

Framework for writing unit tests for SuiteScript code

Testing

 

jest

Framework to simplify and automate the testing process

Testing

Yes

@hitc/netsuite-types

Types for SuiteScript objects and methods

Development

 

eslint

Linter for code quality and adherence to coding standards

Development

 

prettier

Code formatter for consistent style and readability

Development

 

typescript

Language with improved code organization and maintenance

Development

 

typedoc

TypeScript documentation generator

Documentation

 

webpack, webpack-cli

Module bundler to manage dependencies into a single file

Build Automation

 

babel

Compiler core and presets for modern code compatibility

Build Automation

 

gulp

Task runner for build automation

Build Automation

SuiteScript Runtime Compatible Libraries (Dependencies)

Runtime libraries are essential components in supporting software execution. They provide crucial functions for tasks like input/output operations, memory management, and interaction with hardware. These libraries ensure that software operates effectively and efficiently within its runtime environment. In SuiteScript, these libraries, also known as dependencies, are bundled in the final deployed script, and executed within the NetSuite environment. This eliminates the need for separate installations or configurations, simplifying the deployment process.

Here is a summary of the benefits when using runtime-compatible libraries:

  • Enhance software efficiency by providing optimized pre-compiled code.
  • Ensure stability through widespread testing and usage.
  • Expedite development by handling core functionalities, saving time, and reducing the risk of errors.

Here’s a list of run-time compatible libraries that are known to work with SuiteCloud projects:

Built for NS

Library

Description

Category

Yes

netsuite-fasttrack-toolkit-ss2

Framework for writing SuiteScript that scales

Development

 

d3.js

Data visualization framework for interactive data visualizations on the web

Data Visualization

 

bootstrap

Front-end framework with prestyled components and utilities

UI Framework

 

sweetalert2

Modals and alerts

UI Component

 

xlsx

Excel file manipulation

Utility

 

zod

Runtime validation for performant and convenient value validation

Utility

 

lodash

Efficient data manipulation (arrays, numbers, objects, strings, etc.)

Utility

 

luxon

Date and time manipulation (immutable)

Utility

 

jquery

DOM manipulation and event handling

Utility

 

underscore

Functions for common programming tasks

Utility

 

bignumber.js

Big numbersarbitrary-precision decimal numbers

Utility

 

core-js

Standard library polyfills for modern features on older environments

Utility

 

glob

File path matching

Utility

 

immutable

Immutable data structures for JavaScript

Utility

So, you’ve identified a few libraries from the lists above and you’re ready to integrate them into your SuiteCloud project? Click here to follow my step-by-step guide on integrating AMD, non-AMD, and UMD libraries.

For developers wanting to expand beyond this list of known libraries but needing guidance on researching the right third-party libraries for seamless integration, click here. In this guide, I’ll walk you through the process of discovering and vetting third-party libraries to ensure they meet the compatibility standards for both build-time and runtime environments in SuiteScript. This resource is designed to equip you with the knowledge to make informed choices, enhancing your development workflow and project efficiency.

Mohammed Kassem

SuiteCloud Advocate


Previous Post

Resolving Compatibility Challenges with Shims and Polyfills: A Quick Introduction

Mohammed Kassem | 4 min read

Next Post


SuiteScript 2.1 Walkthrough: Node Polyfills with Webpack & stdlib

Mohammed Kassem | 7 min read