Skip to content

Reduce node_modules package size for AWS Lambda deployments #10283

@julienmunio

Description

@julienmunio

Feature Description

I'm facing build issues on my serverless cloud stack due to the weight of the TypeORM dependency package. This is because TypeORM depends on the date-fns library, which is quite large. This feature proposal outlines a plan to reduce the size of the TypeORM dependency package by switching to the dayjs library, which is much smaller. This will make it easier to add other dependencies to my project and reduce the risk of build failures.

The Solution

The solution to this problem is to switch to the dayjs library. Dayjs is a lightweight alternative to date-fns that is much smaller in size. To switch to dayjs, we will need to update a single method DateUtils.mixedDateToDate()

Considered Alternatives

As mentioned in the code comments, an alternative solution is not to use an external lib. But this generates additional code that is not useful to maintain.

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions