IMA.js Documentation

website·Indexed 32 days ago

https://imajs.io/

A JavaScript framework featuring an Object Container for dependency injection, EventBus for event-driven communication, and a Page Manager for view manipulation. It includes an isomorphic HttpAgent for data fetching, server-only JSON controllers, and a dedicated CLI with build configuration via ima.config.js. The framework provides a structured controller lifecycle with init() and load() methods, as well as custom Chrome extension devtools introduced in v17.

Tokens
139K
Snippets
968
Records
1.4K
Agent score
64%

What's inside IMA.js

  1. Overview of ObservableImpl

    ObservableImpl is a class that manages event listeners and distributes events to registered listeners. It maintains a history of events and supports 'persistent events' which are not cleared during route changes. It relies on a Dispatcher to handle the actual distribution of events.
  2. Overview of @ima/dev-utils modules

    The @ima/dev-utils package is organized into the following functional modules:

    • compileErrorParser: Parses compile errors from loaders.
    • cliUtils: Formats errors for CLI output.
    • helpers: General regex patterns and helper functions.
    • sourceFragment: Creates source fragment objects containing a specific number of lines of code around a highlighted line.
    • sourceMapUtils: Extracts source map URLs from file contents.
  3. Overview of the Dictionary class

    The Dictionary class acts as a manager and preprocessor for localization phrases for a single language. The specific format of these phrases depends on the implementation of the interface. It is extended by MessageFormatDictionary.
  4. Overview of the Observable class

    The Observable class is used to manage event listeners and distribute events to registered listeners. It maintains a history of events and supports 'persistent events' which are not cleared during route changes.
  5. Overview of the Namespace utility

    The Namespace class is a utility used to create semi-global shared namespaces. It allows developers to register references to interfaces, classes, and constants, making them accessible across the application more easily than using standard ES6 import/export mechanisms.
  6. Overview of ServerWindow class

    The ServerWindow class is the server-side implementation of the Window utility API. It extends the Window class to provide compatible behavior when the code is running on a server rather than in a browser.
    const window = new ServerWindow();
  7. Overview of the Request class

    The Request class serves as a wrapper for the ExpressJS request object, providing a simplified interface to access request data. It can be used on the server side (wrapping an Express request) or on the client side (where the internal request object is null).
  8. Overview of the Cache class

    The Cache<V> class provides temporary storage for expirable information. It is primarily used to cache data obtained via CPU-heavy computations or networking to improve application performance when the same information is retrieved multiple times.
  9. Overview of the Storage class

    The Storage<V> class is an unordered collection of named values of any type V. Values are accessed and managed using string keys. It serves as a base class for various storage implementations such as CookieStorage, MapStorage, SessionMapStorage, SessionStorage, and WeakMapStorage.
  10. Overview of the EventBus utility

    The EventBus is a utility used to send and intercept wrapped custom DOM events on the DOM or propagate them to the current controller. Events fired via the EventBus always propagate up the DOM tree until they reach the window. To prevent collisions with native custom event names, the EventBus wraps events in custom DOM events with implementation-specific obscure names, while maintaining a consistent actual event name for the user.