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

feat(coverage): second transformer build does not print typescript #3561

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Jun 6, 2024

Currently, we lack a test to check if the TS AST has been completely deleted. I have thought of a way to test it. Let's have our idempotency test print the TypeScript code the first time and the second time print the JavaScript code only. If the two results do not match, it means that there are still undeleted TS ASTs or other bugs. Since ideally the TS ASTs are completely deleted, the two results should be the same.

Copy link

graphite-app bot commented Jun 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

Dunqing commented Jun 6, 2024

Copy link

codspeed-hq bot commented Jun 6, 2024

CodSpeed Performance Report

Merging #3561 will not alter performance

Comparing 06-06-feat_coverage_second_transformer_build_does_not_print_typescript (5c8e16c) with main (37cdc13)

Summary

✅ 22 untouched benchmarks

@Dunqing Dunqing force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch from 4ceed56 to 70c5d61 Compare June 6, 2024 08:41
@Dunqing Dunqing marked this pull request as ready for review June 6, 2024 08:41
@Boshen
Copy link
Member

Boshen commented Jun 6, 2024

Shall we just combine these 2 PRs and fix most things at once?

@overlookmotel
Copy link
Contributor

This is a great idea. But we're missing one possible class of bugs - if TS nodes are left in after 1st transform pass, but deleted in 2nd transform pass, that's a bug, but this test won't catch it currently.

I suggest we codegen twice after 1st pass - once with TS nodes printed, once without - and compare the 2 there.

@Dunqing
Copy link
Member Author

Dunqing commented Jun 6, 2024

Shall we just combine these 2 PRs and fix most things at once?

Wait for me to fix a redundant semicolon issue, this will fix tons of mismatch cases

@Dunqing Dunqing force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch from 70c5d61 to df7d0a4 Compare June 6, 2024 09:25
@github-actions github-actions bot added the A-codegen Area - Code Generation label Jun 6, 2024
@Dunqing Dunqing force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch 2 times, most recently from 5c5cbba to 78d4c88 Compare June 6, 2024 11:42
@Dunqing Dunqing force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch from 78d4c88 to 98a5b03 Compare June 6, 2024 11:56
Copy link

graphite-app bot commented Jun 6, 2024

Merge activity

@Boshen Boshen force-pushed the 06-06-feat_transformer_typescript_remove_typescript_ast_nodes branch from 900bc42 to 81aea1c Compare June 6, 2024 12:20
Boshen pushed a commit that referenced this pull request Jun 6, 2024
…3561)

Currently, we lack a test to check if the TS AST has been completely deleted. I have thought of a way to test it. Let's have our idempotency test print the TypeScript code the first time and the second time print the JavaScript code only. If the two results do not match, it means that there are still undeleted TS ASTs or other bugs. Since ideally the TS ASTs are completely deleted, the two results should be the same.
@Boshen Boshen force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch from 98a5b03 to fa67c9f Compare June 6, 2024 12:20
@Boshen Boshen force-pushed the 06-06-feat_transformer_typescript_remove_typescript_ast_nodes branch from 81aea1c to cd4ae5a Compare June 6, 2024 12:25
Boshen pushed a commit that referenced this pull request Jun 6, 2024
…3561)

Currently, we lack a test to check if the TS AST has been completely deleted. I have thought of a way to test it. Let's have our idempotency test print the TypeScript code the first time and the second time print the JavaScript code only. If the two results do not match, it means that there are still undeleted TS ASTs or other bugs. Since ideally the TS ASTs are completely deleted, the two results should be the same.
@Boshen Boshen force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch from fa67c9f to 7ed6080 Compare June 6, 2024 12:26
…3561)

Currently, we lack a test to check if the TS AST has been completely deleted. I have thought of a way to test it. Let's have our idempotency test print the TypeScript code the first time and the second time print the JavaScript code only. If the two results do not match, it means that there are still undeleted TS ASTs or other bugs. Since ideally the TS ASTs are completely deleted, the two results should be the same.
@Dunqing Dunqing force-pushed the 06-06-feat_transformer_typescript_remove_typescript_ast_nodes branch from cd4ae5a to e8a20f8 Compare June 7, 2024 05:04
@Dunqing Dunqing force-pushed the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch from 7ed6080 to 5c8e16c Compare June 7, 2024 05:05
@Dunqing Dunqing changed the base branch from 06-06-feat_transformer_typescript_remove_typescript_ast_nodes to main June 7, 2024 05:08
@graphite-app graphite-app bot merged commit 5c8e16c into main Jun 7, 2024
22 checks passed
@graphite-app graphite-app bot deleted the 06-06-feat_coverage_second_transformer_build_does_not_print_typescript branch June 7, 2024 05:09
@github-actions github-actions bot mentioned this pull request Jun 7, 2024
Boshen added a commit that referenced this pull request Jun 7, 2024
## [0.13.4] - 2024-06-07

### Features

- 5c8e16c coverage: Second transformer build does not print typescript
(#3561) (Dunqing)
- 646b993 coverage/transformer: Handle @jsx option (#3553) (Dunqing)
- a939ddd transformer/typescript: Remove more typescript ast nodes
(#3563) (Dunqing)
- e8a20f8 transformer/typescript: Remove typescript ast nodes (#3559)
(Dunqing)
- ee9a215 transformer/typescript: Handle namespace directive correctly
(#3532) (Dunqing)

### Bug Fixes

- affb2c8 codegen: Print indentation before directive (#3512) (Dunqing)
- f6939cb transformer: Store `react_importer` in `Bindings` in JSX
transform (#3551) (overlookmotel)
- 7982b93 transformer: Correct spans for JSX transform (#3549)
(overlookmotel)
- c00598b transformer: JSX set `reference_id` on refs to imports (#3524)
(overlookmotel)

### Performance

- 37cdc13 transformer: Faster checks if JSX plugin enabled (#3577)
(overlookmotel)
- 9f467b8 transformer: Avoid fragment update where possible (#3535)
(overlookmotel)
- ac394f0 transformer: JSX parse pragma only once (#3534)
(overlookmotel)

### Documentation

- 1d3c0d7 span: Add doc comments to `oxc_span::Span` (#3543) (Don Isaac)

### Refactor

- f2113ae transformer: Reduce cloning and referencing `Rc`s (#3576)
(overlookmotel)
- 0948124 transformer: Pass `Rc`s by value (#3550) (overlookmotel)
- e4d74ac transformer: Remove `update_fragment` from JSX transform
(#3541) (overlookmotel)
- 73b7864 transformer: Combine import and usage in JSX transform (#3540)
(overlookmotel)
- 6978269 transformer/typescript: Replace reference collector with
symbols references (#3533) (Dunqing)

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area - Code Generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants