Masen Furer
6ae08c38db
Handle double-JSON-encoded VarData
...
In some paths, a Var will have JSON encoded data that is itself JSON encoded
again (like Var[dict] types). If we can't decode the VarData up front, try to
double decode it as a fallback.
2024-03-06 11:51:28 -08:00
Benedikt Bartscher
cdc2f4f6e0
cleanup unneeded init_subclass super calls
2024-03-05 21:59:59 +01:00
Benedikt Bartscher
6d96a94d82
fix chakra list, allow Tag.tag to be None in validation
2024-03-05 21:53:44 +01:00
Benedikt Bartscher
16a7c1ff51
fix bug in memoization mode copy
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
be0a77a66f
pydantic_init_subclass
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
30df32bd16
add default value for new lang prop in Html
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
7ac184f98b
rebuild pydantic model after dropping id field
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
bcd29a10e6
use typing.get_args instead of __args__
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
3c30ceb7f7
new regex missed f-strings
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
16b838dfb1
format component.library black
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
bcaab3015d
add Component.alias str type annotation
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
16b7baef80
add Component.library str type annotation
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
f44d0edc38
add Component.is_default bool type annotation
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
935286b464
add Component.tag str type annotation
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
7534b2caf2
my regex was not smart enough
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
99c28f8433
add proper pydantic v2 FieldInfo annotation
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
32bc17b757
minor IconButton default value fix
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
db3c791603
add hint for VarData deserialization
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
0240541d0b
migrate pydantic config classes to ConfigDict
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
b3593537be
fix VarData json loads
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
b565e8934a
dict -> model_dump and field_info fixes
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
b65c34b212
update_forward_refs -> model_rebuild
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
45cb36f59a
pydantic copy is deprecated in favor of model_copy
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
37c360e786
fix init_subclass for pydantic v2, add some missing type hints, format black
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
80f02753ba
add some missing type hints to test state vars
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
4380cd266d
fix pydantic _get_value for MutableProxy
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
7789118af3
prevent calling __bool__ for is_hydrated
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
211f9f3598
fix auto-var conversion
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
78db90d695
forgot to migrate one type_ to annotation
2024-03-05 21:36:41 +01:00
Benedikt Bartscher
d0f15c591d
optionalize all Var props without defaults
2024-03-05 21:36:39 +01:00
Benedikt Bartscher
fd5a5b97f2
Bare.contents should be a Var
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
1c89f012b6
optionalize some Component props
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
6d3809efcb
ModelField doesn't exist in pydantic v2
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
8c7dd39f02
fix EventSpec args type annotation for pydantic v2
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
80a25d6b29
add missing type annotation for initialColorMode
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
4d497e0053
hacky workaround to allow __class_getitem__ with pydantic
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
1abc57c68b
fix default value for theme in ChakraProvider
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
5c584da4ef
add missing default values to icon and link
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
7f8a457d74
migrate to field.annotation and fix default var wrapping for undefined
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
c057f2e3f3
minor pydantic fixups
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
2def8b97e7
FieldInfo has no name anymore
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
faebd22185
black fixes
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
a5d197c2fb
serialization fixes
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
6291c39fd7
minor state fixes, and var serialization
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
fd32942eb4
parse_obj is deprecated in favor of model_validate
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
66f1e21576
fix backend vars
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
67c81489cf
migrate remaining __fields__ to model_fields
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
ce06bf0114
migrate config to pydantic v2
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
8b2d0b40bc
outer_type_ -> annotation
2024-03-05 21:35:53 +01:00
Benedikt Bartscher
95f9b12829
types adjustments
2024-03-05 21:35:53 +01:00