Skip to content

Commit 047e1ef

Browse files
Memory usage optimization (#3139)
Trying to import `typescript` dynamically in order to avoid excessive memory consumption. Addresses #3126 Using `createRequire` for sync approach — This is kinda a workaround, because the proper implementation would need: - `import()` and `async`, which is breaking - or moving to another entrypoint or another package, which is breaking as well <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** - Unified internal TypeScript generation engine while keeping public interfaces compatible. * **Chores** - Deferred TypeScript import to reduce memory usage during normal operations. - Bumped package version to 26.1.0-beta.2. - Updated changelog and added a contributor entry. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8dc8b43 commit 047e1ef

File tree

9 files changed

+851
-770
lines changed

9 files changed

+851
-770
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Version 26
44

5+
### v26.1.0
6+
7+
- Optimization to the memory consumption for your API:
8+
- It has been discovered that static import of `typescript` within the framework consumes memory unnecessarily;
9+
- Importing `typescript` is only necessary to generate an Integration;
10+
- This version avoids static importing, but the solution is temporary in order to avoid breaking changes;
11+
- The issue was found, investigated and reported by [@NicolasMahe](https://github.com/NicolasMahe).
12+
513
### v26.0.0
614

715
- Supported `http-errors` versions: `^2.0.1`;

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Therefore, many basic tasks can be accomplished faster and easier, in particular
8585

8686
These people contributed to the improvement of the framework by reporting bugs, making changes and suggesting ideas:
8787

88+
[<img src="https://github.com/NicolasMahe.png" alt="@NicolasMahe" width="50" />](https://github.com/NicolasMahe)
8889
[<img src="https://github.com/shadone.png" alt="@shadone" width="50" />](https://github.com/shadone)
8990
[<img src="https://github.com/squishykid.png" alt="@squishykid" width="50" />](https://github.com/squishykid)
9091
[<img src="https://github.com/jakub-msqt.png" alt="@jakub-msqt" width="50" />](https://github.com/jakub-msqt)

express-zod-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "express-zod-api",
3-
"version": "26.0.0",
3+
"version": "26.1.0-beta.2",
44
"description": "A Typescript framework to help you get an API server up and running with I/O schema validation and custom middlewares in minutes.",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)