Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 19, 2025

Remove dependency on assert-unchecked crate, and implement assert_unchecked! macro in oxc_data_structures crate instead.

This re-implementation has 2 advantages over the previous version:

  1. Use Rust's native assert_unchecked function, introduced in Rust 1.81.0.
  2. Usable in const functions.

Copy link
Member Author

overlookmotel commented Mar 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-parser Area - Parser A-semantic Area - Semantic C-enhancement Category - New feature or request labels Mar 19, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 19, 2025

CodSpeed Performance Report

Merging #9885 will create unknown performance changes

Comparing 03-19-feat_data_structures_add_assert_unchecked_macro (38ad787) with main (9314147)

Summary

🆕 33 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.6 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 65.7 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 57.8 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 20.9 µs N/A
🆕 lexer[antd.js] N/A 24.1 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.7 ms N/A
🆕 lexer[checker.ts] N/A 14.5 ms N/A
🆕 lexer[pdf.mjs] N/A 3.8 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 2.9 s N/A
🆕 mangler[antd.js] N/A 15.8 ms N/A
🆕 mangler[react.development.js] N/A 292.9 µs N/A
🆕 mangler[typescript.js] N/A 39.3 ms N/A
🆕 minifier[antd.js] N/A 163.2 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 288.1 ms N/A
🆕 estree[checker.ts] N/A 87.5 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 91 µs N/A
🆕 parser[antd.js] N/A 112.4 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@overlookmotel overlookmotel force-pushed the 03-19-feat_data_structures_add_assert_unchecked_macro branch from 2ded941 to e1cd1a7 Compare March 19, 2025 05:44
@overlookmotel overlookmotel marked this pull request as ready for review March 19, 2025 05:44
@overlookmotel overlookmotel marked this pull request as draft March 19, 2025 05:45
@overlookmotel overlookmotel marked this pull request as ready for review March 19, 2025 08:41
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Mar 19, 2025
Copy link
Member

Boshen commented Mar 19, 2025

Merge activity

  • Mar 19, 4:50 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 19, 4:50 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 19, 5:03 AM EDT: A user merged this pull request with the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 03-19-test_data_structures_enable_doc_tests_for_oxc_data_structures_crate branch from 61b6caa to 062b2a8 Compare March 19, 2025 08:50
graphite-app bot pushed a commit that referenced this pull request Mar 19, 2025
Remove dependency on [assert-unchecked](https://crates.io/crates/assert-unchecked) crate, and implement `assert_unchecked!` macro in `oxc_data_structures` crate instead.

This re-implementation has 2 advantages over the previous version:

1. Use Rust's native [`assert_unchecked`](https://doc.rust-lang.org/std/hint/fn.assert_unchecked.html) function, introduced in Rust 1.81.0.
2. Usable in const functions.
@graphite-app graphite-app bot force-pushed the 03-19-feat_data_structures_add_assert_unchecked_macro branch from e1cd1a7 to c3988a2 Compare March 19, 2025 08:51
Remove dependency on [assert-unchecked](https://crates.io/crates/assert-unchecked) crate, and implement `assert_unchecked!` macro in `oxc_data_structures` crate instead.

This re-implementation has 2 advantages over the previous version:

1. Use Rust's native [`assert_unchecked`](https://doc.rust-lang.org/std/hint/fn.assert_unchecked.html) function, introduced in Rust 1.81.0.
2. Usable in const functions.
@graphite-app graphite-app bot force-pushed the 03-19-test_data_structures_enable_doc_tests_for_oxc_data_structures_crate branch from 062b2a8 to 9314147 Compare March 19, 2025 08:52
@graphite-app graphite-app bot force-pushed the 03-19-feat_data_structures_add_assert_unchecked_macro branch from c3988a2 to 38ad787 Compare March 19, 2025 08:53
Base automatically changed from 03-19-test_data_structures_enable_doc_tests_for_oxc_data_structures_crate to main March 19, 2025 09:02
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 19, 2025
@graphite-app graphite-app bot merged commit 38ad787 into main Mar 19, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 03-19-feat_data_structures_add_assert_unchecked_macro branch March 19, 2025 09:03
Boshen added a commit that referenced this pull request Mar 20, 2025
## [0.61.0] - 2025-03-20

- c631291 parser: [**BREAKING**] Parse `TSImportAttributes` as
`ObjectExpression` (#9902) (Boshen)

- eef7eb6 minifier: [**BREAKING**] Rename
`CompressOptions::all_true`/`all_false` to `smallest`/`safest` (#9866)
(sapphi-red)

### Features

- 38ad787 data_structures: Add `assert_unchecked!` macro (#9885)
(overlookmotel)
- dcd356e minifier: Support `keep_names` option (#9867) (sapphi-red)
- 6565fc4 napi: Feature gate allocator (#9921) (Boshen)
- 2cedfe4 napi: Add codeframe to napi error (#9893) (Boshen)
- a9a47a6 parser: Add regex cargo feature to oxc_parser (#9879) (Toshit)
- d4a83ba parser: Report duplicate modifier `Accessibility modifier
already seen.` (#9890) (Boshen)
- 59c8f71 parser,codegen: Handle lone surrogate in string literal
(#9918) (Boshen)

### Bug Fixes

- 28a2ed3 estree/ast: Fix `IdentifierName` and `IdentifierReference`
(#9863) (hi-ogawa)
- 3d4c5f3 semantic: Correctly visit `IfStmt` `test` when building cfg
(#9864) (camc314)
- 1774225 transformer/using: Incorrect scope ids for bindings (#9871)
(camc314)- 68018e1 Ast changes (Boshen)

### Performance

- 5f97f28 ast/estree: Speed up raw deser for `JSXElement` (#9895)
(overlookmotel)
- b272893 mangler, minifier: Initialize a Vec with a specific value
using `Vec::from_iter_in` combined with `repeat_with` (#9908) (Dunqing)
- f7d078c semantic: Use `reserve_exact` instead of `reserve` to save
memory in pre-reserve (#9910) (Dunqing)

### Documentation

- 590a258 napi/parser: Add stackblitz link for wasm build (Boshen)

### Refactor

- 62e2859 ast/ast_builder: Use `self.vec_from_iter` instead of
`Vec::from_iter_in` for consistency (#9909) (Dunqing)
- b2f3d23 isolated_declarations: Remove unused `self` params (#9868)
(overlookmotel)
- 961b95d napi: Move common code to `oxc_napi` (#9875) (Boshen)
- 233c1fc napi/playground: Add JSON.parse wrapper (#9880) (Hiroshi
Ogawa)
- dbe61c5 transformer/module-runner-transform: Remove redundant
converison (#9912) (Dunqing)
- ecdfe2e transformer/using: Move work to `exit_static_block` (#9713)
(camc314)

### Testing

- 9314147 data_structures: Enable doc tests for `oxc_data_structures`
crate (#9884) (overlookmotel)
- 040e993 napi: Refactor NAPI parser benchmarks (#9911) (overlookmotel)
- e637e2e napi/parser: Tweak vitest config (#9878) (Hiroshi Ogawa)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser A-semantic Area - Semantic C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants