Use string-store for customId creation #10
Labels
package: core
Addresses the core package
package: framework
Addresses the framework package
priority: medium
Medium priority issue
status: needs information
Lacks information for further progress
type: feature request
Addition of a new feature
The current customId de/serialization logic works through the
CustomIdBuilder
s, which uses indexes to add metadata and user generated data to the string. This works, but it comes with a few caveats, namely:All of these issues can be solved with @sapphire/string-store, which is also made with Discord customId's in mind, unlike other string serialization libraries.
We need to solve one main issue to implement it, though: should it be included in
core
, or onlyframework
?Including it in
core
Advantages
Disadvantages
core
is meant to be minimal. Adding a new library to it goes against that idea.Only in
framework
Advantages
framework
is also meant to be minimal, it's also meant as a recommended/supported implementation ofcore
, and adding a library that we think is the best way of approaching a problem would go in favor of that.Disadvantages
CustomIdBuilder
return a string, but then the user won't be able to append any extra data. The only way to export a buildable one would be to makecore
itself return the store or schema, aka. depending on it. We can't completely remove customId serialization, since sessions depend on that (specifically to extract the ID). I'm currently thinking about using interaction IDs instead, but that'll be tackled in another issue, and this will be later revised.In essence the current most considered approaches are:
core
depend on it, and basically replace every method that returnsCustomIdBuilder
with a schema builder.framework
depend on it, but completely remove every customId related feature (command customId references, session IDs would need to use something else).The text was updated successfully, but these errors were encountered: