RequireJS is a JavaScript file and module loader that makes it easier to manage library references and is designed to improve the speed and quality of your code.
RequireJS implements the Asynchronous Module Definition (AMD) API which provides a mechanism for asynchronously loading a module and its dependencies.
Oracle JET's modular organization enables application developers to load a subset of needed features without having to execute require() calls for each referenced object. Each Oracle JET module represents one functional area of the framework, and it typically defines more than one JavaScript object. The ojs/ojcore module defines the oj namespace object, and all subsequently loaded modules place their exported objects within the oj namespace.
Note:
Oracle JET reserves the oj namespace, and you may not use oj as a namespace in your Oracle JET application.
You do not have to use RequireJS to reference Oracle JET libraries, but it is required if you plan to use Oracle JET's internationalization or data visualization components in your application. The Oracle JET download includes the RequireJS library, and it is used by default in the Oracle JET QuickStart templates and Cookbook examples.
For more information about RequireJS, see http://requirejs.org.
The Oracle JET modules are listed in the following table with description and usage tips. Use this table to determine which modules you must load in your application.
| Oracle JET Module | Description | When to Use? |
|---|---|---|
|
|
Core framework module that defines a base Oracle JET object. Includes support for prototype-based JavaScript object inheritance and extending JavaScript objects by copying their properties. The module returns |
Always |
|
|
Oracle JET's Common Model |
Use if your application uses the Oracle JET Common Model. |
|
|
Utilities for integrating Oracle JET's Common Model into Knockout.js |
Use if your application uses the Oracle JET Common Model, and you want to integrate with Knockout.js. |
|
|
Data validation and conversion services |
Use if your application uses Oracle JET validators or converters outside of Oracle JET editable components. |
|
|
Support for the |
Use if your application uses validators or converters, and you want to track the validity of the Oracle JET components in your application. |
|
Examples:
|
Oracle JET component modules. Most Oracle JET components have their own module with the same name in lowercase, except for the following components:
|
Use component modules that correspond to any Oracle JET component in your application. |
|
|
Oracle JET |
Use if your application includes Oracle JET components and you want to use |
|
|
Class for managing routing in single page applications |
Use if your single page application uses |
|
|
Binding for Knockout.js that implements navigation within a region of a single page application |
Use if your single page application uses the |
|
|
Methods for controlling off-canvas regions |
Use if your application uses |
|
|
Class for aggregating data values in |
Use if your application renders aggregated cubic data in an |
Note:
Oracle JET includes several modules that aren't listed in this table because they are dependencies of other modules. When you load an Oracle JET component module, the module's dependencies are also loaded by default, and you do not need to include them explicitly. For example, ojTabs requires the ojs/ojcomponentcore module, and the ojs/ojcomponentcore module will load automatically when you specify the ojs/ojtabs module in your RequireJS bootstrap file.