Skip to content

Conversation

@Eranziel
Copy link

@Eranziel Eranziel commented Sep 3, 2025

This PR updates many-level to use the API as defined by abstract-level 2.0. It is supporting work for a matching PR on rave-level: Level/rave-level#13

In general, this means everything has been converted from callbacks to promises. Unfortunately it does not encompass all of the work required to update many-level; our use case does not use all of the features of many-level, so due to limited time and competing priorities I had to forego solving several test failures which do not affect our use case.

A few notable changes:

  • I updated the minimum node version to 16, matching abstract-level 2.0.
  • I added a new npm script, test:stacktrace, which I found invaluable while debugging failing tests.
  • I did not implement a system for aborting in-flight operations when an Abort error is thrown. This would surely be very useful for some applications, but unfortunately (or fortunately for me?) it was not relevant to our use case. There are a handful of TODO comments in the code relevant to this.
  • I have attempted to conform to the prevailing code style, but deviated on a few points:
    • I renamed the guest and host iterator classes to be more descriptive, because I repeatedly got confused between the two.
    • I did add descriptive comments in several places that were particularly unintuitive. I hope these aren't an issue, because honestly it was quite difficult to gain an initial understanding of several parts of the code when I started working on this.

While this isn't a complete update in and of itself, I hope this serves useful on the road to 2.0!

Eranziel and others added 27 commits February 26, 2025 10:48
- Still need to refactor handling of outstanding reqs
- Still need to refactor rpc stream event handlers to not use req/iterator callbacks
- Determine if we need a new mechanism for passing errors up to request initiator
We still need an internal callback since the host response occurs in a separate call stack, so it cannot be directly awaited.
Refactor to classic-level 2.0 API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant