Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Builder pattern from burr #24

Merged
merged 9 commits into from
Nov 23, 2024
Merged

Use Builder pattern from burr #24

merged 9 commits into from
Nov 23, 2024

Conversation

orta
Copy link
Member

@orta orta commented Nov 9, 2024

Uses the new builder API I came up with for burr

} catch (error) {}

export const formatDTS = async (path: string, content: string): Promise<string> => {
if (!hasPrettierInstalled) return content

try {
const prettier = await import("prettier")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might have been slow because of the dynamic import?

@orta
Copy link
Member Author

orta commented Nov 11, 2024

Greens on the Puzzmo codebase

Screenshot 2024-11-11 at 09 38 56

@orta
Copy link
Member Author

orta commented Nov 11, 2024

stdout | src/tests/integration.puzzmo.test.ts > Puzzmo > Runs the entire puzzmo codebase fast
[sdl-codegen] Read the GraphQL schema
[sdl-codegen] Read the GraphQL schema: 102.85ms
[sdl-codegen] Read the Prisma schema
[sdl-codegen] Read the Prisma schema: 70.97ms
[sdl-codegen] Create shared schema files
[sdl-codegen] Creating shared schema files
[sdl-codegen] Creating shared schema files: 98.763ms
[sdl-codegen] Creating shared return position schema files
[sdl-codegen] Creating shared return position schema files: 48.075ms
[sdl-codegen] Create shared schema files: 147.026ms
[sdl-codegen] Create DTS files for all services
[sdl-codegen] Create DTS files for all services: 730.681ms
[sdl-codegen]: Full run took 1053ms

@orta orta marked this pull request as ready for review November 11, 2024 09:40
@orta
Copy link
Member Author

orta commented Nov 11, 2024

speculative name for the builder: conform (of the Danger family)

@orta
Copy link
Member Author

orta commented Nov 12, 2024

Sans prettier

[sdl-codegen] Read the GraphQL schema
[sdl-codegen] Read the GraphQL schema: 120.586ms
[sdl-codegen] Read the Prisma schema
[sdl-codegen] Read the Prisma schema: 68.898ms
[sdl-codegen] Create shared schema files
[sdl-codegen] Creating shared schema files
[sdl-codegen] Creating shared schema files: 93.514ms
[sdl-codegen] Creating shared return position schema files
[sdl-codegen] Creating shared return position schema files: 31.124ms
[sdl-codegen] Create shared schema files: 124.849ms
[sdl-codegen] Create DTS files for all services
[sdl-codegen] Create DTS files for all services: 751.862ms
[sdl-codegen]: Full run took 1070ms

With prettier

stdout | src/tests/integration.puzzmo.test.ts > Puzzmo > Runs the entire puzzmo codebase fast
[sdl-codegen] Read the GraphQL schema
[sdl-codegen] Read the GraphQL schema: 158.037ms
[sdl-codegen] Read the Prisma schema
[sdl-codegen] Read the Prisma schema: 116.549ms
[sdl-codegen] Create shared schema files
[sdl-codegen] Creating shared schema files
[sdl-codegen] Creating shared schema files: 344.757ms
[sdl-codegen] Creating shared return position schema files
[sdl-codegen] Creating shared return position schema files: 132.745ms
[sdl-codegen] Create shared schema files: 477.722ms
[sdl-codegen] Create DTS files for all services
[sdl-codegen] Create DTS files for all services: 1.019s
[sdl-codegen]: Full run took 1777ms

@orta
Copy link
Member Author

orta commented Nov 12, 2024

Explored a separate babel printer: https://github.com/putoutjs/printer - #25

[sdl-codegen] Read the GraphQL schema
[sdl-codegen] Read the GraphQL schema: 119.873ms
[sdl-codegen] Read the Prisma schema
[sdl-codegen] Read the Prisma schema: 68.777ms
[sdl-codegen] Create shared schema files
[sdl-codegen] Creating shared schema files
[sdl-codegen] Creating shared schema files: 155.163ms
[sdl-codegen] Creating shared return position schema files
[sdl-codegen] Creating shared return position schema files: 55.476ms
[sdl-codegen] Create shared schema files: 211.011ms
[sdl-codegen] Create DTS files for all services
[sdl-codegen] Create DTS files for all services: 798.738ms
[sdl-codegen]: Full run took 1200ms

its stricter about making perfect ASTs though, and so a bunch of code is lost

@orta orta merged commit 953d0b8 into main Nov 23, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant