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

Typed Array discoverability #909

Merged
merged 31 commits into from
Sep 14, 2022
Merged

Typed Array discoverability #909

merged 31 commits into from
Sep 14, 2022

Commits on Jul 22, 2022

  1. WIP

    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    e5ee685 View commit details
    Browse the repository at this point in the history
  2. - Use aquamarine crate to product the type hierarchy diagram in neon:…

    …: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
    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    6d136af View commit details
    Browse the repository at this point in the history
  3. Types diagram cosmetics:

    - change from top-to-bottom to left-to-right
    - make rectangles rounded
    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    a50522e View commit details
    Browse the repository at this point in the history
  4. - Divide type hierarchy diagram into two diagrams and add some more c…

    …opy around them
    
    - Turn every node in the diagrams into a link to the relevant type's API docs
    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    04f122e View commit details
    Browse the repository at this point in the history
  5. Prettier

    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    321bb68 View commit details
    Browse the repository at this point in the history
  6. cargo fmt fixes

    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    5b5da7e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    bbcd086 View commit details
    Browse the repository at this point in the history
  8. Move Binary trait into crate::types::buffer::private so it doesn'…

    …t show up in docs.
    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    9172444 View commit details
    Browse the repository at this point in the history
  9. Add missing module.

    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    9db2163 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ff4e501 View commit details
    Browse the repository at this point in the history
  11. Elide lifetimes

    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    1a49e5b View commit details
    Browse the repository at this point in the history
  12. - Change from_array_buffer() to from_buffer_region() and add more…

    … 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
    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    84c5fd8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    bbf3cda View commit details
    Browse the repository at this point in the history
  14. Make JsTypedArray into a wide pointer (like JsBox) that caches al…

    …l the metadata, avoiding extra FFI calls to
    
    retrieve that data.
    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    45780d5 View commit details
    Browse the repository at this point in the history
  15. Docs copy edit

    dherman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    e119b79 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    03c0cf9 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    776ba84 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3f0fc4c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    ffb089b View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2022

  1. Test byteOffset as well

    dherman committed Jul 23, 2022
    Configuration menu
    Copy the full SHA
    480298c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5785b96 View commit details
    Browse the repository at this point in the history
  3. Add a Region type to represent a typed region of a buffer:

    - Shorten `from_buffer_region` to `from_region`
    - Add symmetric `to_region` method, which only requires a single `napi_get_typed_array_info` FFI call
    dherman committed Jul 23, 2022
    Configuration menu
    Copy the full SHA
    6bc6aaa View commit details
    Browse the repository at this point in the history
  4. rustfmt

    dherman committed Jul 23, 2022
    Configuration menu
    Copy the full SHA
    9cf8c53 View commit details
    Browse the repository at this point in the history
  5. prettier

    dherman committed Jul 23, 2022
    Configuration menu
    Copy the full SHA
    28b6136 View commit details
    Browse the repository at this point in the history
  6. fix doc test

    dherman committed Jul 23, 2022
    Configuration menu
    Copy the full SHA
    912b178 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2022

  1. Update for latest RFC changes:

    - byte_offset -> offset
    - byte_length -> size
    - to_region -> region
    - to_typed_array and region take &self
    - JsArrayBuffer::region static method, for doc discoverability
    dherman committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    f24f1e7 View commit details
    Browse the repository at this point in the history
  2. - API tweak: TypedArray::Item must implement Binary

    - add tests about region validation
    dherman committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    74251cb View commit details
    Browse the repository at this point in the history
  3. prettier

    dherman committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    326a9d0 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2022

  1. Address review suggestions:

    - 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
    dherman committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    aa6c655 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f6c2143 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. Configuration menu
    Copy the full SHA
    7fb1779 View commit details
    Browse the repository at this point in the history