Skip to content

Conversation

@anotherjesse
Copy link
Contributor

@anotherjesse anotherjesse commented Apr 27, 2025

Store the recipes in the space with the charms!

New recipeManager runner/src/recipe-manager.ts

  • Unified, persistent recipe + syncing layer
  • recipes are only stored in the space, but can optionally be published to blobby.
    • SpellBook will now publish to blobby on a share
      • this opens up a place for versioning/users keeping up-to-date with published recipes)
  • Auto-migration - if the recipe source/metadata isn't stored in the space, attempt to fetch for blobby
    • for backwards migrations, we will still publish to blobby ALWAYS, until we are sure we aren't going to need to roll back

Other changes:

  • compile now throws if default export missing (it was returning undefined)

woohoo - so close - existing works, but new fail

more cleanup

more wip
@anotherjesse
Copy link
Contributor Author

rebasing #1088 was complex, and so I want to keep it in its original state while I try to finish this branch

@anotherjesse
Copy link
Contributor Author

it says all the tests are passing, but I know I ripped out module support when creating the new recipe manager

either I didn't do as much damage as I thought. or more likely we don't have adequate coverage for it

@anotherjesse
Copy link
Contributor Author

fyi: @bfollington @jsantell

I had to tweak some of your recent changes to work with this patch

once we start compiling, use a shared promise to send to anyone else asking for the compiled version
Comment on lines 917 to 930
let argumentJson: Record<string, any>;
try {
if (isArgumentExpanded) {
argumentJson = translateCellsAndStreamsToPlainJSON(
charmManager.getArgument(charm).get(),
) as Record<string, any>;
} else {
argumentJson = {};
}
} catch (error) {
console.warn("Error translating argument to JSON:", error);
argumentJson = {};
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: wrapping in useMemo would be better again for render perf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea - should we do it for this below as well:

              value={translateCellsAndStreamsToPlainJSON(charm.get()) ?? {}}

I had moved it out of inline jsx because getArgument now throws (see above)

Copy link
Contributor

@bfollington bfollington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, couple of questions I'd like to answer before merging. I will try and answer them myself but might run out of time today.

@bfollington bfollington merged commit 8c5db81 into main Apr 28, 2025
5 checks passed
@bfollington bfollington deleted the cell-recipes-redux branch April 28, 2025 01:38
@sentry
Copy link

sentry bot commented Apr 28, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: Recipe undefined has no stored source /:replicaName/:charmId View Issue

Did you find this useful? React with a 👍 or 👎

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.

4 participants