Skip to content

Configuration: Outdated ES5 target generates larger and less efficient code #342

@evmparser

Description

@evmparser

Problem

The TypeScript compiler target in tsconfig.json is currently set to "es5", which is a very old JavaScript standard released in 2009.

File: tsconfig.json (line 10)

Impact

This outdated configuration results in several significant issues:

  • Larger bundle sizes: Modern JavaScript features must be transpiled down to ES5, requiring extensive polyfills and transformation code
  • Less efficient code execution: ES5-compatible code runs slower than modern JavaScript optimized for newer engines
  • Inability to use modern JavaScript features natively: Native async/await, arrow functions, classes, and other modern features must be transpiled
  • Slower performance for cryptographic operations: For a cryptography SDK handling FHE (Fully Homomorphic Encryption), performance is critical

Why This Matters for an FHE SDK

Modern cryptographic operations are computationally intensive. Using an outdated ES5 target means:

  • Users get larger bundles to download
  • Runtime performance is degraded
  • Modern JavaScript engine optimizations cannot be utilized

Suggested Fix

Update the TypeScript compiler target in tsconfig.json:

{
  "compilerOptions": {
    "target": "es2020",  // or "esnext" for cutting-edge features
    // ... rest of config
  }
}

Benefits:

  • ✅ Smaller bundle sizes (up to 30-40% reduction)
  • ✅ Better runtime performance
  • ✅ Compatible with all modern Node.js versions (14+) and browsers
  • ✅ Cleaner, more maintainable output code

Context

This issue was identified as part of a comprehensive configuration audit of the relayer-sdk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions