Skip to content

Commit a3ff927

Browse files
feat(ditsmod): upgrade npm packages and added bun integration. (#9213)
1 parent 61ebc14 commit a3ff927

17 files changed

+349
-16
lines changed

frameworks/TypeScript/ditsmod/benchmark_config.json

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,138 @@
130130
"display_name": "ditsmod [mysql & simplified use of di]",
131131
"notes": "Simplified use of Dependency Injection (no request level injector).",
132132
"versus": "nodejs"
133+
},
134+
"bun": {
135+
"dockerfile": "ditsmod-bun.dockerfile",
136+
"json_url": "/json",
137+
"plaintext_url": "/plaintext",
138+
"port": 8080,
139+
"approach": "Realistic",
140+
"classification": "Micro",
141+
"database": "None",
142+
"framework": "Ditsmod",
143+
"language": "TypeScript",
144+
"flavor": "None",
145+
"orm": "None",
146+
"platform": "bun",
147+
"webserver": "None",
148+
"os": "Linux",
149+
"database_os": "Linux",
150+
"display_name": "Ditsmod on bun",
151+
"notes": "",
152+
"versus": "bun"
153+
},
154+
"simplified-di-bun": {
155+
"dockerfile": "ditsmod-bun.dockerfile",
156+
"json_url": "/json2",
157+
"plaintext_url": "/plaintext2",
158+
"port": 8080,
159+
"approach": "Realistic",
160+
"classification": "Micro",
161+
"database": "None",
162+
"framework": "Ditsmod",
163+
"language": "TypeScript",
164+
"flavor": "None",
165+
"orm": "None",
166+
"platform": "bun",
167+
"webserver": "None",
168+
"os": "Linux",
169+
"database_os": "Linux",
170+
"display_name": "ditsmod on bun [simplified use of di]",
171+
"notes": "Simplified use of Dependency Injection (no request level injector).",
172+
"versus": "bun"
173+
},
174+
"postgres-bun": {
175+
"dockerfile": "ditsmod-bun-postgres.dockerfile",
176+
"db_url": "/db",
177+
"query_url": "/queries?queries=",
178+
"update_url": "/updates?queries=",
179+
"cached_query_url": "/cached-queries?count=",
180+
"fortune_url": "/fortunes",
181+
"port": 8080,
182+
"approach": "Realistic",
183+
"classification": "Micro",
184+
"database": "Postgres",
185+
"framework": "Ditsmod",
186+
"language": "TypeScript",
187+
"flavor": "None",
188+
"orm": "Raw",
189+
"platform": "bun",
190+
"webserver": "None",
191+
"os": "Linux",
192+
"database_os": "Linux",
193+
"display_name": "ditsmod on bun [postgres]",
194+
"notes": "",
195+
"versus": "bun"
196+
},
197+
"mysql-bun": {
198+
"dockerfile": "ditsmod-bun-mysql.dockerfile",
199+
"db_url": "/db",
200+
"query_url": "/queries?queries=",
201+
"update_url": "/updates?queries=",
202+
"cached_query_url": "/cached-queries?count=",
203+
"fortune_url": "/fortunes",
204+
"port": 8080,
205+
"approach": "Realistic",
206+
"classification": "Micro",
207+
"database": "MySQL",
208+
"framework": "Ditsmod",
209+
"language": "TypeScript",
210+
"flavor": "None",
211+
"orm": "Raw",
212+
"platform": "bun",
213+
"webserver": "None",
214+
"os": "Linux",
215+
"database_os": "Linux",
216+
"display_name": "ditsmod on bun [mysql]",
217+
"notes": "",
218+
"versus": "bun"
219+
},
220+
"postgres2-bun": {
221+
"dockerfile": "ditsmod-bun-postgres.dockerfile",
222+
"db_url": "/db2",
223+
"query_url": "/queries2?queries=",
224+
"update_url": "/updates2?queries=",
225+
"cached_query_url": "/cached-queries2?count=",
226+
"fortune_url": "/fortunes2",
227+
"port": 8080,
228+
"approach": "Realistic",
229+
"classification": "Micro",
230+
"database": "Postgres",
231+
"framework": "Ditsmod",
232+
"language": "TypeScript",
233+
"flavor": "None",
234+
"orm": "Raw",
235+
"platform": "bun",
236+
"webserver": "None",
237+
"os": "Linux",
238+
"database_os": "Linux",
239+
"display_name": "ditsmod on bun [postgres & simplified use of di]",
240+
"notes": "Simplified use of Dependency Injection (no request level injector).",
241+
"versus": "bun"
242+
},
243+
"mysql2-bun": {
244+
"dockerfile": "ditsmod-bun-mysql.dockerfile",
245+
"db_url": "/db2",
246+
"query_url": "/queries2?queries=",
247+
"update_url": "/updates2?queries=",
248+
"cached_query_url": "/cached-queries2?count=",
249+
"fortune_url": "/fortunes2",
250+
"port": 8080,
251+
"approach": "Realistic",
252+
"classification": "Micro",
253+
"database": "MySQL",
254+
"framework": "Ditsmod",
255+
"language": "TypeScript",
256+
"flavor": "None",
257+
"orm": "Raw",
258+
"platform": "bun",
259+
"webserver": "None",
260+
"os": "Linux",
261+
"database_os": "Linux",
262+
"display_name": "ditsmod on bun [mysql & simplified use of di]",
263+
"notes": "Simplified use of Dependency Injection (no request level injector).",
264+
"versus": "bun"
133265
}
134266
}
135267
]
58 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM oven/bun:1.1
2+
3+
COPY ./ ./
4+
5+
RUN bun install
6+
RUN bun run build
7+
8+
ENV NODE_ENV production
9+
ENV IS_BUN true
10+
ENV DATABASE mysql
11+
ENV MYSQL_HOST tfb-database
12+
ENV MYSQL_USER benchmarkdbuser
13+
ENV MYSQL_PSWD benchmarkdbpass
14+
ENV MYSQL_DBNAME hello_world
15+
16+
EXPOSE 8080
17+
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun src/app/bun-integration/spawn.ts
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM oven/bun:1.1
2+
3+
COPY ./ ./
4+
5+
RUN bun install
6+
RUN bun run build
7+
8+
ENV NODE_ENV production
9+
ENV IS_BUN true
10+
ENV DATABASE postgres
11+
ENV PG_HOST tfb-database
12+
ENV PG_USER benchmarkdbuser
13+
ENV PG_PSWD benchmarkdbpass
14+
ENV PG_DBNAME hello_world
15+
16+
EXPOSE 8080
17+
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun src/app/bun-integration/spawn.ts
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM oven/bun:1.1
2+
3+
COPY ./ ./
4+
5+
RUN bun install
6+
RUN bun run build
7+
8+
ENV NODE_ENV production
9+
ENV IS_BUN true
10+
11+
EXPOSE 8080
12+
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun src/app/bun-integration/spawn.ts

frameworks/TypeScript/ditsmod/ditsmod-mysql.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.17.1-slim
1+
FROM node:20.16-slim
22

33
COPY ./ ./
44

frameworks/TypeScript/ditsmod/ditsmod-postgres.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.17.1-slim
1+
FROM node:20.16-slim
22

33
COPY ./ ./
44

frameworks/TypeScript/ditsmod/ditsmod.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.17.1-slim
1+
FROM node:20.16-slim
22

33
COPY ./ ./
44

frameworks/TypeScript/ditsmod/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@
1919
"author": "Костя Третяк",
2020
"license": "MIT",
2121
"dependencies": {
22-
"@ditsmod/core": "~2.51.1",
23-
"@ditsmod/routing": "~2.1.0",
22+
"@ditsmod/core": "~2.54.2",
23+
"@ditsmod/routing": "~2.3.0",
2424
"handlebars": "^4.7.8",
25-
"lru-cache": "^10.0.1",
26-
"mariadb": "^3.2.1",
27-
"postgres": "^3.3.5"
25+
"lru-cache": "^11.0.0",
26+
"mariadb": "^3.3.1",
27+
"postgres": "^3.4.4"
2828
},
2929
"devDependencies": {
3030
"@types/eslint": "^8.44.2",
3131
"@types/node": "^20.5.7",
3232
"@typescript-eslint/eslint-plugin": "^6.5.0",
3333
"@typescript-eslint/parser": "^6.5.0",
34+
"bun-types": "^1.1.22",
3435
"eslint": "^8.48.0",
3536
"prettier": "^3.0.2",
3637
"typescript": "^5.2.2"
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import { Providers, rootModule } from '@ditsmod/core';
1+
import { PreRouter, rootModule } from '@ditsmod/core';
2+
23
import { SimpleModule } from '#routed/simple/simple.module.js';
4+
import { BunPreRouter } from './bun-integration/pre-router.js';
5+
import { BunProviders } from './bun-integration/bun-providers.js';
36

47
@rootModule({
58
appends: [SimpleModule],
6-
providersPerApp: [...new Providers().useLogConfig({ level: 'off' })],
9+
providersPerApp: [
10+
...new BunProviders().useLogConfig({ level: 'off' }).if(process.env.IS_BUN).useClass(PreRouter, BunPreRouter),
11+
],
712
})
813
export class AppModule {}

0 commit comments

Comments
 (0)