-
Notifications
You must be signed in to change notification settings - Fork 284
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
Typed Array discoverability #909
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dherman
changed the title
[draft] Typed Array discoverability
Typed Array discoverability
Jul 1, 2022
dherman
commented
Jul 1, 2022
kjvalencik
reviewed
Jul 1, 2022
kjvalencik
reviewed
Jul 1, 2022
dherman
commented
Jul 1, 2022
dherman
force-pushed
the
typed-array-discoverability
branch
from
July 8, 2022 17:57
0a79f32
to
7ac46cb
Compare
kjvalencik
reviewed
Jul 8, 2022
kjvalencik
reviewed
Jul 8, 2022
dherman
commented
Jul 11, 2022
kjvalencik
reviewed
Jul 11, 2022
dherman
force-pushed
the
typed-array-discoverability
branch
from
July 12, 2022 07:12
1601966
to
bdf4a41
Compare
…:types API docs - Delete the PowerPoint-generated digram - Refactor the module tree slightly, in order to wrap the module docs with `#[aquamarine]` attribute - Flesh out the remaining blank spots in the typed array API docs - Change the `Binary` trait to use an associated constant instead of a nullary method
- change from top-to-bottom to left-to-right - make rectangles rounded
…opy around them - Turn every node in the diagrams into a link to the relevant type's API docs
…t show up in docs.
… convenient `from_buffer()` - Add `TypedArray::byte_length()` - Add `JsTypedArray::{byte_offset, buffer}` - Revert visibility of Binary back to public to enable typed array abstractions - Add tests for buffer aliasing and argument validation - Add tests for `byte_length`, `byte_offset`, and `buffer` methods
…l the metadata, avoiding extra FFI calls to retrieve that data.
dherman
force-pushed
the
typed-array-discoverability
branch
from
July 22, 2022 21:00
26a4d59
to
3f0fc4c
Compare
- Shorten `from_buffer_region` to `from_region` - Add symmetric `to_region` method, which only requires a single `napi_get_typed_array_info` FFI call
kjvalencik
reviewed
Jul 25, 2022
- byte_offset -> offset - byte_length -> size - to_region -> region - to_typed_array and region take &self - JsArrayBuffer::region static method, for doc discoverability
- add tests about region validation
kjvalencik
reviewed
Aug 3, 2022
kjvalencik
requested changes
Aug 4, 2022
kjvalencik
reviewed
Aug 10, 2022
- make doc-related crates (doc-comment, aquamarine) optional - `Binary` only requires `Clone`, not `Copy` or `Debug` - `Region` API changes * still impls Copy but all its methods take a reference * range checks throw `RangeError` instead of panicking - minor code improvements * copy-editing nit in doc comment * `buffer/types.rs` imports from `types_impl` not `types` so it's clear why it has private access * use `map_err` to clean up some code * simplify `detach` test helper function
kjvalencik
reviewed
Sep 8, 2022
kjvalencik
reviewed
Sep 8, 2022
kjvalencik
approved these changes
Sep 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds API docs for typed arrays, as well as several conveniences in the API:
JsTypedArray::new()
andJsTypedArray::from_buffer
for constructing typed array objectsJsUint32Array
)Collectively, these changes should make the Neon typed arrays API more discoverable and easier to get started using.
RFC: neon-bindings/rfcs#47