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

Move Spin interfaces into their own packages #2882

Open
itowlson opened this issue Oct 9, 2024 · 2 comments
Open

Move Spin interfaces into their own packages #2882

itowlson opened this issue Oct 9, 2024 · 2 comments

Comments

@itowlson
Copy link
Contributor

itowlson commented Oct 9, 2024

As part of Spin 3, we hope to add new interfaces (e.g. wasi:keyvalue/store) and possibly modify some existing ones (e.g. rdbms-types). So we are likely to need to define new worlds and it seems plausible that they will need to go in a new package version, e.g. fermyon:[email protected]. (Please consider this assumption open to challenge. I am not confident in how this stuff fits together.)

At the moment, all our interfaces (e.g. key-value, sqlite, mysql) are in the fermyon:spin package, meaning they must be versioned together. However, many of these interfaces will not change. This is a pattern we're likely to see again and again over time.

We should consider moving each interface into its own package (e.g. spin:[email protected], spin:[email protected]) and having the top-level fermyon:spin package and worlds import these as dependencies. This would allow interfaces to be revved independently instead of as a big bang. Thus fermyon:spin/[email protected] might import spin:[email protected] and spin:[email protected]; later, fermyon:spin/[email protected] might rev to spin:[email protected] but still remain on spin:[email protected].

This could also help with modularising SDKs as distinct packages could be pulled in by direct references.

The initial move would be a larger change but the hope is that this would allow us to make smaller and more granular changes in future, and to treat Spin APIs in a similar way to externally defined APIs such as wasi-cloud-core.

@lann
Copy link
Collaborator

lann commented Oct 10, 2024

A slight variation to consider here would be to only rename (re-package?) those interfaces that are actually getting breaking changes. While this would make things less consistent, it would also avoid a bunch of boilerplate code like needing to implement identical fermyon:spin/http and spin:http/outbound (?) interfaces. As I type that, it occurs to me that it would also avoid needing to come up with some interface names... 😅

@itowlson
Copy link
Contributor Author

I like the idea of doing it incrementally. I am guessing we will need to move fermyon:[email protected] into deps anyway so that the top-level package can be fermyon:[email protected], and the 3.0 package can cite unchanged interfaces a la fermyon:spin/[email protected]. Only when we change the SQLite interface would we pull it out to its own package. Does that sound right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants