-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
DUMP #265
Comments
|
|
Remove Static vecs
Should
Using Break out language exporters into dedicated crates The Can we somehow remove Specta's dependance on Public constructor for
Lint for enabling |
This is an old document in my notes that I wanna dump here. Will think about it again in the furture so that all of it will a pound of salt.
``
#[specta(optional)]
should not work on unnamed fields + add into trybuild`comments: Vec<Cow<..>>` or `doc: Option<Cow<..>>` should probs just all be `doc: Cow<..>` for consistency
Should `EnumType` have `deprecated` and `comments`. Logically right now it's on `NamedDataType` but it's also a wacky disparity.
Are we properly escaping enum tags. I have a feeling they could contain invalid chars for a TS name or even reserved words???
Defined order for handling multiple conflicting attributes either within a single attribute or across multiple attributes.
Should
specta::lang::js_doc
bespecta::lang::ts::js_doc
???Should
#[specta(optional)]
change?Should
#[specta(transparent)]
change? Right now a reference to it is to the type name but Serde kinda imply in their docs that it should be a direct passthrough to the single inner field. If not changing it we should have something to handle the opposite case + unit test it with#[specta(optional)]
on the single field.Unit test using
inline
andtransparent
together cause they cause issues. Especially with attributes applied to the inner value like#[specta(optional)]
.Does exporting doc comments on redundant conditions break then removable of the redundant conditions?
For usage with
to_named
it might make sense to allow mutable changes todeprecated
,doc
, etc onNamedDataType
2.0.0-rc.4
:Abstraction for collecting up types and their dependant types into a file
Examples using the
TypeMap
andType
trait directly + docs explaining the methods onType
Cleanup
DefOpts
Run rustfmt workflow in CI
Rewrite TS exporter to clean it up
Cleanup macros
Deprecated - Export Rust deprecated parameter #32
Language overrides - Per language type overrides #110
[DRAFT] Add in support for duplicate type names across modules #72
Does it make sense to remove
macros/src/attrs/enum
. See how Serde handles those attributes on astruct
.Error for
#[serde(tag = "...")] can only be used on enums and structs with named fields
Error for
#[serde(content = "...")] can only be used on enums
- Add to Specta macrosFilter out redundant conditions in
&
or||
#134Specta docs overhaul
So the mental model is the that inline only applies to the type you call it on, if you want more inner stuff inlined it's on you to use the attributes. Although certain types will always inline like
Vec
,Option
, etc.Thursday:
specta::Serialize
??specta::json
?? -specta::json
#105Refactor TS exporter to use string joining instead of
Vec
's so save allocations + also just give it a general cleanup!type CowStr = Cow<'static, str>;
Can
TypeMap
's value not beOption
? I have a feeling it doesn't need to be anymore.Put
TypeMap
intoExportContext
Vec<impl Into<DataType> for DataType
should be forUntaggedEnum
On a struct with named fields: Serialize the struct's name (or value of serde(rename)) as a field with the given key, in front of all the real fields of the struct.
Future:
Type::definition_generics
NamedType
are cringeextra-traits
feature for debug and the like#[specta(inline)]
a recursive field it will stackoverflow. Make this a proper error instead!impl Iterator<Item = &T> + ExactSizeIterator
or something instead of returning&Vec<T>
, etc. Keep it consistentSpectaFunction
be a public trait cause it's got a rough signature????Seal
DefOpts
Go through and do my best to seal enum types
For flatten right now we export
({ a: string }) & ({ a: string }) but we should export ({ a: string })
Aleph-Alpha/ts-rs#165
Aleph-Alpha/ts-rs#152
Aleph-Alpha/ts-rs#153
Can
TypeMap
should/should it not holdOption<NamedDataType>
??? Technically using a type in a partially constructed state is bad.[f32; 4]
should export as a Typescript tuple of length 4Make
#[serde(untagged)]
enum work?Review public API and doc and improve them
Example of function exporting without 3rd party library
Document features
Document different export methods and when to use them
Stuff from phone
Discuss enum types and tagging, etc
DefOpts.parent_inline
document what it actually does// TODO: Does
inline
,definition
andreference
all need to exist and explain themDesign
Why not use Rust TypeId -> Limitations with lifetime
etc
Make NamedDataType.export work
Inlining a recursive type -> What happens? Unit test
Put all language exporter other than
ts
behind "unstable" feature flagShould Specta v2 keep the impls for external crates because we can't ever remove them once published and moving the impls into the downstream crate would be better performance.
Break up the current language exporters into their crates and remove from Specta itself???
Rename
internal
module to__unstable
so it's less likely to be in LSP hints and to make it clear it's not to be used.Unit tests for stupid types -> Assoicated types, assoicated constants, with and without bounds, etc
export
feature work with assoicated types, does Serde?The text was updated successfully, but these errors were encountered: