Skip to content

Commit 0ffacd9

Browse files
refactor(ditsmod): upgrade Ditsmod, removed bun specific TypeScript code (#9216)
* chore(ditsmod): upgrade Ditsmod, removed bun.lockb and bun-providers.ts. * refactor(ditsmod): removed bun specific TypeScript code. * refactor(ditsmod): significantly simplifying the structure of the app and reducing the number of tests.
1 parent b4cb3fe commit 0ffacd9

31 files changed

+116
-548
lines changed

frameworks/TypeScript/ditsmod/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist*
55
.pnp*
66
nodemon.json
77
package-lock.json
8+
bun.lockb

frameworks/TypeScript/ditsmod/benchmark_config.json

Lines changed: 10 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"tests": [
44
{
55
"default": {
6+
"dockerfile": "ditsmod.dockerfile",
67
"json_url": "/json",
78
"plaintext_url": "/plaintext",
89
"port": 8080,
@@ -17,31 +18,12 @@
1718
"webserver": "None",
1819
"os": "Linux",
1920
"database_os": "Linux",
20-
"display_name": "Ditsmod",
21-
"notes": "",
22-
"versus": "nodejs"
23-
},
24-
"simplified-di": {
25-
"dockerfile": "ditsmod.dockerfile",
26-
"json_url": "/json2",
27-
"plaintext_url": "/plaintext2",
28-
"port": 8080,
29-
"approach": "Realistic",
30-
"classification": "Micro",
31-
"database": "None",
32-
"framework": "Ditsmod",
33-
"language": "TypeScript",
34-
"flavor": "None",
35-
"orm": "None",
36-
"platform": "nodejs",
37-
"webserver": "None",
38-
"os": "Linux",
39-
"database_os": "Linux",
40-
"display_name": "ditsmod [simplified use of di]",
21+
"display_name": "ditsmod",
4122
"notes": "Simplified use of Dependency Injection (no request level injector).",
4223
"versus": "nodejs"
4324
},
4425
"postgres": {
26+
"dockerfile": "ditsmod-postgres.dockerfile",
4527
"db_url": "/db",
4628
"query_url": "/queries?queries=",
4729
"update_url": "/updates?queries=",
@@ -60,10 +42,11 @@
6042
"os": "Linux",
6143
"database_os": "Linux",
6244
"display_name": "ditsmod [postgres]",
63-
"notes": "",
45+
"notes": "Simplified use of Dependency Injection (no request level injector).",
6446
"versus": "nodejs"
6547
},
6648
"mysql": {
49+
"dockerfile": "ditsmod-mysql.dockerfile",
6750
"db_url": "/db",
6851
"query_url": "/queries?queries=",
6952
"update_url": "/updates?queries=",
@@ -82,52 +65,6 @@
8265
"os": "Linux",
8366
"database_os": "Linux",
8467
"display_name": "ditsmod [mysql]",
85-
"notes": "",
86-
"versus": "nodejs"
87-
},
88-
"postgres2": {
89-
"dockerfile": "ditsmod-postgres.dockerfile",
90-
"db_url": "/db2",
91-
"query_url": "/queries2?queries=",
92-
"update_url": "/updates2?queries=",
93-
"cached_query_url": "/cached-queries2?count=",
94-
"fortune_url": "/fortunes2",
95-
"port": 8080,
96-
"approach": "Realistic",
97-
"classification": "Micro",
98-
"database": "Postgres",
99-
"framework": "Ditsmod",
100-
"language": "TypeScript",
101-
"flavor": "None",
102-
"orm": "Raw",
103-
"platform": "nodejs",
104-
"webserver": "None",
105-
"os": "Linux",
106-
"database_os": "Linux",
107-
"display_name": "ditsmod [postgres & simplified use of di]",
108-
"notes": "Simplified use of Dependency Injection (no request level injector).",
109-
"versus": "nodejs"
110-
},
111-
"mysql2": {
112-
"dockerfile": "ditsmod-mysql.dockerfile",
113-
"db_url": "/db2",
114-
"query_url": "/queries2?queries=",
115-
"update_url": "/updates2?queries=",
116-
"cached_query_url": "/cached-queries2?count=",
117-
"fortune_url": "/fortunes2",
118-
"port": 8080,
119-
"approach": "Realistic",
120-
"classification": "Micro",
121-
"database": "MySQL",
122-
"framework": "Ditsmod",
123-
"language": "TypeScript",
124-
"flavor": "None",
125-
"orm": "Raw",
126-
"platform": "nodejs",
127-
"webserver": "None",
128-
"os": "Linux",
129-
"database_os": "Linux",
130-
"display_name": "ditsmod [mysql & simplified use of di]",
13168
"notes": "Simplified use of Dependency Injection (no request level injector).",
13269
"versus": "nodejs"
13370
},
@@ -139,35 +76,15 @@
13976
"approach": "Realistic",
14077
"classification": "Micro",
14178
"database": "None",
142-
"framework": "Ditsmod",
79+
"framework": "ditsmod-bun",
14380
"language": "TypeScript",
14481
"flavor": "None",
14582
"orm": "None",
14683
"platform": "bun",
14784
"webserver": "None",
14885
"os": "Linux",
14986
"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]",
87+
"display_name": "ditsmod on bun",
17188
"notes": "Simplified use of Dependency Injection (no request level injector).",
17289
"versus": "bun"
17390
},
@@ -182,7 +99,7 @@
18299
"approach": "Realistic",
183100
"classification": "Micro",
184101
"database": "Postgres",
185-
"framework": "Ditsmod",
102+
"framework": "ditsmod-bun",
186103
"language": "TypeScript",
187104
"flavor": "None",
188105
"orm": "Raw",
@@ -191,7 +108,7 @@
191108
"os": "Linux",
192109
"database_os": "Linux",
193110
"display_name": "ditsmod on bun [postgres]",
194-
"notes": "",
111+
"notes": "Simplified use of Dependency Injection (no request level injector).",
195112
"versus": "bun"
196113
},
197114
"mysql-bun": {
@@ -205,7 +122,7 @@
205122
"approach": "Realistic",
206123
"classification": "Micro",
207124
"database": "MySQL",
208-
"framework": "Ditsmod",
125+
"framework": "ditsmod-bun",
209126
"language": "TypeScript",
210127
"flavor": "None",
211128
"orm": "Raw",
@@ -214,52 +131,6 @@
214131
"os": "Linux",
215132
"database_os": "Linux",
216133
"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]",
263134
"notes": "Simplified use of Dependency Injection (no request level injector).",
264135
"versus": "bun"
265136
}
-58 KB
Binary file not shown.

frameworks/TypeScript/ditsmod/ditsmod-bun-mysql.dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ RUN bun install
66
RUN bun run build
77

88
ENV NODE_ENV production
9-
ENV IS_BUN true
109
ENV DATABASE mysql
1110
ENV MYSQL_HOST tfb-database
1211
ENV MYSQL_USER benchmarkdbuser
1312
ENV MYSQL_PSWD benchmarkdbpass
1413
ENV MYSQL_DBNAME hello_world
1514

1615
EXPOSE 8080
17-
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun src/app/bun-integration/spawn.ts
16+
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun dist/main.js

frameworks/TypeScript/ditsmod/ditsmod-bun-postgres.dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ RUN bun install
66
RUN bun run build
77

88
ENV NODE_ENV production
9-
ENV IS_BUN true
109
ENV DATABASE postgres
1110
ENV PG_HOST tfb-database
1211
ENV PG_USER benchmarkdbuser
1312
ENV PG_PSWD benchmarkdbpass
1413
ENV PG_DBNAME hello_world
1514

1615
EXPOSE 8080
17-
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun src/app/bun-integration/spawn.ts
16+
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun dist/main.js

frameworks/TypeScript/ditsmod/ditsmod-bun.dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ RUN bun install
66
RUN bun run build
77

88
ENV NODE_ENV production
9-
ENV IS_BUN true
109

1110
EXPOSE 8080
12-
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun src/app/bun-integration/spawn.ts
11+
CMD rm node_modules/@ditsmod/*/tsconfig.json && bun dist/main.js

frameworks/TypeScript/ditsmod/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@
1010
"build": "tsc -b tsconfig.build.json",
1111
"clean": "rm -rf dist*"
1212
},
13-
"imports": {
14-
"#routed/*": "./dist/app/modules/routed/*",
15-
"#service/*": "./dist/app/modules/service/*",
16-
"#utils/*": "./dist/app/utils/*"
17-
},
1813
"keywords": [],
1914
"author": "Костя Третяк",
2015
"license": "MIT",
2116
"dependencies": {
22-
"@ditsmod/core": "~2.54.2",
17+
"@ditsmod/core": "~2.55.0",
2318
"@ditsmod/routing": "~2.3.0",
2419
"handlebars": "^4.7.8",
2520
"lru-cache": "^11.0.0",
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import { PreRouter, rootModule } from '@ditsmod/core';
1+
import { Providers, rootModule } from '@ditsmod/core';
2+
import { PRE_ROUTER_EXTENSIONS, RoutingModule } from '@ditsmod/routing';
23

3-
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';
4+
import { OneController } from './one.controller.js';
5+
import { DbService } from './db.service.js';
6+
import { InitExtension } from './init.extension.js';
7+
import { DB_INIT_EXTENSIONS } from './tokens.js';
8+
import { ModelService } from './types.js';
69

710
@rootModule({
8-
appends: [SimpleModule],
9-
providersPerApp: [
10-
...new BunProviders().useLogConfig({ level: 'off' }).if(process.env.IS_BUN).useClass(PreRouter, BunPreRouter),
11-
],
11+
imports: [RoutingModule],
12+
providersPerApp: new Providers().passThrough(DbService).passThrough(ModelService).useLogConfig({ level: 'off' }),
13+
extensions: [{ extension: InitExtension, groupToken: DB_INIT_EXTENSIONS, nextToken: PRE_ROUTER_EXTENSIONS }],
14+
controllers: [OneController],
1215
})
1316
export class AppModule {}

frameworks/TypeScript/ditsmod/src/app/bun-integration/bun-application.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

frameworks/TypeScript/ditsmod/src/app/bun-integration/bun-providers.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)