Skip to content
Richard Sustek edited this page Apr 3, 2025 · 7 revisions

Modernization 2025

This repository is currently outdated both functionally and technically. To ensure long-term maintainability, scalability, and alignment with modern development standards, a comprehensive review and modernization effort is required.

Objectives

The key areas of focus for this modernization initiative include:

  1. Dependency Audit
    Review all existing dependencies and update or remove them as needed to eliminate deprecated or redundant packages.

  2. Testing Framework Migration
    Replace the deprecated karma testing framework with vitest. All tests should be rewritten accordingly to adopt modern testing practices.

  3. TypeScript Upgrade
    Update TypeScript to the latest stable version and apply a modernized tsconfig configuration.

  4. Build Tooling Simplification
    Consider removing webpack and the UMD bundle format, subject to further discussion, in favor of simpler and more modern alternatives.

  5. Codebase Refactoring

    • Transition toward a more functional programming style where appropriate
    • Replace interface definitions prefixed with I with type aliases
    • Improve overall code structure, readability, and consistency
  6. Barrel File Removal
    Eliminate the use of barrel files to reduce indirection and improve clarity.

  7. Public API Simplification
    Only expose relevant and useful components in the public API to keep the library lean and developer-friendly.

  8. Selective Use of Classes
    Favor simple data structures over classes, reserving class usage for specific scenarios (e.g., custom error handling where class instances offer advantages).

  9. Model Simplification
    Remove the distinction between contract and model structures. This separation, originally introduced to convert snake_case API responses into camelCase, has added unnecessary complexity and maintenance overhead with minimal benefit.

  10. Output Format Standardization
    Consolidate the distribution format by selecting a single modern module target (e.g., ES2024 or ESNext, to be finalized). Avoid publishing multiple module formats (such as CommonJS and ESM) to simplify build configuration, reduce maintenance overhead, and align with modern ecosystem expectations.

  11. Embrace Immutability
    Promote the use of immutable data structures and apply readonly modifiers where applicable. This practice enhances code reliability, reduces unintended side effects, and makes the codebase easier to reason about and maintain. Adopt ts-pattern where applicable.

  12. Replace Axios with Native Fetch API
    Remove the axios dependency in favor of the native fetch API. This reduces external dependencies, aligns with modern JavaScript standards, and provides a lighter, more maintainable HTTP client implementation.


Delivery & Management SDK Enhancements

As part of the modernization effort, SDK-specific functionality will be reviewed to ensure alignment with current best practices and developer expectations.

  • Delivery SDK:
    Evaluate and improve key areas such as the query builder API, including parameter and filter handling. Consider enhancements like providing IntelliSense support for elements and system fields to improve the developer experience and reduce potential errors.

  • Management SDK:
    Introduce support for strongly typed models, along with improved type safety and the use of type guards. These enhancements will make the SDK more reliable, predictable, and easier to work with in strongly typed environments like TypeScript.

Additional improvements and edge cases may be identified during the review process, but these areas represent a solid foundation for targeted enhancements.


This modernization effort will position the project for future growth and align it with current best practices in the TypeScript and JavaScript ecosystem.

Clone this wiki locally