-
Notifications
You must be signed in to change notification settings - Fork 110
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
Rust SDK: group all codegen'd names exported from the SDK under pub mod __codegen
#1900
Open
gefjon
wants to merge
7
commits into
master
Choose a base branch
from
phoebe/sdk-dunder-codegen-module
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
This turns out to be effectively a prerequisite for client-side indices. Storing indexes in a type-erased way while making them `Clone` for storage in `im::HashMap` is likely possible, but it's at least very challenging and complex. Given that we no longer actually need the concurrent persistence offered by `im::HashMap`, it seems easier to just revert to using `std::collections::HashMap`.
gefjon
force-pushed
the
phoebe/sdk-dunder-codegen-module
branch
from
October 24, 2024 16:11
758baa1
to
f6a954b
Compare
As opposed to having a bunch of `#[doc(hidden)] pub mod`s with a variety of different purposes. This means we can reorganize the SDK internals without breaking codegen.
gefjon
force-pushed
the
phoebe/sdk-dunder-codegen-module
branch
from
October 24, 2024 17:29
d529c12
to
eca780e
Compare
2 tasks
bfops
added
release-1.0
release-any
To be landed in any release window
and removed
release-1.0
labels
Oct 28, 2024
kazimuth
reviewed
Nov 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything here makes sense to me, but again, I'm not the most familiar with the Rust SDK so I'd like it if this got more eyes on it.
/// | ||
/// `TableHandle`s don't actually hold a direct reference to the table they access, | ||
/// as that would require both gnarly lifetimes and also a `MutexGuard` on the client cache. | ||
/// Instead, they hold an `Arc<Mutex>` on the whole [`ClientCache`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obligatory:
- what if we used
RwLock
- nah we can do that later.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Description of Changes
Based on #1897 . While writing that PR, I moved a definition from
db_connection.rs
toclient_cache.rs
. This needlessly broke codegen.Rather than having the codegen rely on a whole bunch of different
#[doc(hidden)] pub mod
s in the SDK library by path, group every name the codegen refers to underspacetimedb_sdk::__codegen
. This has several benefits:__codegen
module.In a similar vein, the unstable interface Cloud use(s|d) to set its client address is moved to
spacetimedb_sdk::unstable
. This may end up getting removed anyways; I'm not sure what the plan is going forward for how cloud nodes will identify themselves.API and ABI breaking changes
Breaks codegen. Minor user-facing breakage:
u256, i256
are now re-exported from the SDK root rather than via thespacetimedb_sdk::sats::{u256, i256}
. Thesats
crate is no longer fully re-exported, so users who want it will need a separate dependency.Expected complexity level and risk
1
Testing