Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 10, 2025

Add a safety constraint to docs for String::from_raw_parts_in. That the Vec provided comprises a valid UTF-8 string is a pivotal requirement of this method. I'm not sure how we missed documenting that!

Also remove a line of extraneous code from the example.

Copy link
Member Author

overlookmotel commented Mar 10, 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 the C-docs Category - Documentation. Related to user-facing or internal documentation label Mar 10, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 10, 2025

CodSpeed Performance Report

Merging #9640 will create unknown performance changes

Comparing 03-07-docs_allocator_add_safety_constraint_for_string_from_raw_parts_in_ (31a2618) with main (44101bd)

Summary

🆕 39 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 parser_napi[RadixUIAdoptionSection.jsx] N/A 4.8 ms N/A
🆕 parser_napi[pdf.mjs] N/A 1.8 s N/A
🆕 parser_napi_raw[RadixUIAdoptionSection.jsx] N/A 1.3 ms N/A
🆕 parser_napi_raw[cal.com.tsx] N/A 698 ms N/A
🆕 parser_napi_raw[checker.ts] N/A 1.1 s N/A
🆕 parser_napi_raw[pdf.mjs] N/A 266.3 ms N/A
🆕 codegen[checker.ts] N/A 23.1 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 66.1 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.7 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 20.8 µ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 16.1 ms N/A
🆕 mangler[react.development.js] N/A 294.3 µs N/A
🆕 mangler[typescript.js] N/A 39.7 ms N/A
... ... ... ... ...

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

@overlookmotel overlookmotel force-pushed the 03-07-refactor_allocator_optimize_and_improve_safty_comments_of_string_from_strs_array_in_ branch from 8d9618b to c394d37 Compare March 10, 2025 06:53
@overlookmotel overlookmotel force-pushed the 03-07-docs_allocator_add_safety_constraint_for_string_from_raw_parts_in_ branch from 48f23d9 to 3457c8c Compare March 10, 2025 06:53
@overlookmotel overlookmotel marked this pull request as ready for review March 10, 2025 07:41
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Mar 10, 2025
Copy link
Member

Boshen commented Mar 10, 2025

Merge activity

  • Mar 10, 5:15 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 10, 5:15 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 10, 5:33 AM EDT: A user merged this pull request with the Graphite merge queue.

#9640)

Add a safety constraint to docs for `String::from_raw_parts_in`. That the `Vec` provided comprises a valid UTF-8 string is a pivotal requirement of this method. I'm not sure how we missed documenting that!

Also remove a line of extraneous code from the example.
@graphite-app graphite-app bot force-pushed the 03-07-refactor_allocator_optimize_and_improve_safty_comments_of_string_from_strs_array_in_ branch from c394d37 to 44101bd Compare March 10, 2025 09:16
@graphite-app graphite-app bot force-pushed the 03-07-docs_allocator_add_safety_constraint_for_string_from_raw_parts_in_ branch from 3457c8c to 31a2618 Compare March 10, 2025 09:16
Base automatically changed from 03-07-refactor_allocator_optimize_and_improve_safty_comments_of_string_from_strs_array_in_ to main March 10, 2025 09:23
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 10, 2025
@graphite-app graphite-app bot merged commit 31a2618 into main Mar 10, 2025
35 checks passed
@graphite-app graphite-app bot deleted the 03-07-docs_allocator_add_safety_constraint_for_string_from_raw_parts_in_ branch March 10, 2025 09:33
Boshen added a commit that referenced this pull request Mar 11, 2025
## [0.57.0] - 2025-03-11

- 510446a parser: [**BREAKING**] Align JSXNamespacedName with ESTree
(#9648) (Arnaud Barré)

- b0d979d semantic: [**BREAKING**] Make `Scoping::references` private
(#9629) (Boshen)

- 3c6f140 semantic: [**BREAKING**] Make `Scoping` methods consistent
(#9628) (Boshen)

- ef6e0cc semantic: [**BREAKING**] Combine `SymbolTable` and `ScopeTree`
into `Scoping` (#9615) (Boshen)

- 7331656 semantic: [**BREAKING**] Rename `SymbolTable` and `ScopeTree`
methods (#9613) (Boshen)

- 23738bf semantic: [**BREAKING**] Introduce `Scoping` (#9611) (Boshen)

### Features

- b6deff8 ecmascript: Support integer index access for array and string
in `may_have_side_effects` (#9603) (sapphi-red)
- 047fb01 minifier: Place `void 0` on right hand side if possible
(#9606) (sapphi-red)
- 36f8703 minifier: Compress `[] + string` to `string` (#9602)
(sapphi-red)
- 554c4ce minifier: Compress constant integer index access (#9604)
(sapphi-red)
- e3c2015 minifier: Allow compressing computed __proto__ more precisely
(#9595) (sapphi-red)
- 6a57198 minifier: Allow compressing computed constructor/prototype
keys precisely (#9594) (sapphi-red)
- 638007b parser: Apply `preserveParens` to `TSParenthesizedType`
(#9653) (Boshen)

### Bug Fixes

- eae1a41 ast: Align `TSImportType` field names with ts-eslint (#9664)
(Boshen)
- 96eef8b ecmascript: `(foo() + "").length` may have a side effect
(#9605) (sapphi-red)
- 24d9261 minifier: Remove names from functions / classes in normal pass
to make the minifier idempotent (#9608) (sapphi-red)
- 6ac3635 napi/parser: Disable raw transfer on unsupported platforms
(#9651) (overlookmotel)
- cfdcfdb parser: Fix end span for optional binding pattern without type
annotation (#9652) (Boshen)
- 26da65d parser: Parse asi after class accessor property (#9623)
(Boshen)
- 87462fd parser: Fix end span for `using` declaration (#9622) (Boshen)
- 29edb51 transformer: Fix module runner transform of export default
expression (#9661) (hi-ogawa)

### Documentation

- 31a2618 allocator: Add safety constraint for
`String::from_raw_parts_in` (#9640) (overlookmotel)

### Refactor

- 44101bd allocator: Refactor and improve safty comments of
`String::from_strs_array_in` (#9639) (overlookmotel)
- c6edafe napi: Remove `npm/oxc-*/` npm packages (#9631) (Boshen)
- a43c341 semantic: Add `Scoping` to `Semantic` (#9614) (Boshen)

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

C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants