feat: use single sanity instance#828
Draft
cngonzalez wants to merge 2 commits intorefactor/sdk-1335/turn-project-dataset-pairs-into-resourcesfrom
Draft
feat: use single sanity instance#828cngonzalez wants to merge 2 commits intorefactor/sdk-1335/turn-project-dataset-pairs-into-resourcesfrom
cngonzalez wants to merge 2 commits intorefactor/sdk-1335/turn-project-dataset-pairs-into-resourcesfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Bundle Stats —
|
| Metric | Value | vs refactor/sdk-1335/turn-project-dataset-pairs-into-resources (343c228) | vs v2.10.0 |
|---|---|---|---|
| Internal (raw) | 195.5 KB | - | -2.0 KB, -1.0% |
| Internal (gzip) | 43.5 KB | - | -312 B, -0.7% |
| Bundled (raw) | 1.12 MB | - | -9.5 KB, -0.8% |
| Bundled (gzip) | 259.6 KB | - | -1.9 KB, -0.7% |
| Import time | 208ms | +1ms, +0.4% | +10ms, +5.3% |
@sanity/sdk/_internal
| Metric | Value | vs refactor/sdk-1335/turn-project-dataset-pairs-into-resources (343c228) | vs v2.10.0 |
|---|---|---|---|
| Internal (raw) | 70.5 KB | -389 B, -0.5% | -913 B, -1.2% |
| Internal (gzip) | 16.5 KB | -77 B, -0.5% | -239 B, -1.4% |
| Bundled (raw) | 504.9 KB | -389 B, -0.1% | +267 B, +0.1% |
| Bundled (gzip) | 121.3 KB | -85 B, -0.1% | +91 B, +0.1% |
| Import time | 131ms | +2ms, +1.5% | +9ms, +7.0% |
🗺️ . · ./_internal · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/sdk-react
Compared against refactor/sdk-1335/turn-project-dataset-pairs-into-resources (343c2282) · v2.10.0 (npm)
| Metric | Value | vs refactor/sdk-1335/turn-project-dataset-pairs-into-resources (343c228) | vs v2.10.0 |
|---|---|---|---|
| Internal (raw) | 80.4 KB | -464 B, -0.6% | +2.5 KB, +3.3% |
| Internal (gzip) | 19.0 KB | -133 B, -0.7% | +576 B, +3.0% |
| Bundled (raw) | 1.24 MB | -865 B, -0.1% | -7.3 KB, -0.6% |
| Bundled (gzip) | 289.8 KB | -228 B, -0.1% | -1.5 KB, -0.5% |
| Import time | 241ms | -0ms, -0.1% | +13ms, +5.6% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2af1d41 to
bf58e3a
Compare
bf58e3a to
307d14e
Compare
307d14e to
fd3b9af
Compare
fd3b9af to
23b78e6
Compare
bbc4468 to
343c228
Compare
23b78e6 to
d0c1650
Compare
This file contains hidden or 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
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.
Description
Another v3 banger brought over to v2. For a while now, there's been no need to find instances by configuration. Every utility that requires a
projectIdanddatasetcan be bound to any instance, not just the instance that has a a specific configuration. This PR flattens this and shares a single instance across aSanityApp.This could subtly be considered a breaking change in one way that I can think of. If a user wanted to get the configuration of where they're currently "at" in the component tree, they could do the following:
const instance = useSanityInstance()instance.config.projectIdandinstance.config.datasetAnd then get the currently active
projectIdanddataset. Now that's not so reliable so we should ship auseResourceto cover the gap.What to review
Any other possibly breaking behavior?
Testing
Mostly tests were removed.
Fun gif