Files
tasks/chasm/library_core.go
Yichao YangandGitHub d96da03c34 CHASM: Auto sync visibility SA and memo from root component (#8330)
## What changed?
- Add Visibility SearchAttribute and Memo provider interface. If a root
component implements those interfaces, and also uses a Visibility
component, CHASM framework will automatically invoke those two
interfaces and sync SA & memo.


## Why?
- This saves component author from calling UpdateSA/Memo() method
whenever some attributes get updated. They can focus on updating the
component state and CHASM automatically perform the updates to
visibility

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [x] added new functional test(s)
2025-10-01 23:36:19 -07:00

27 lines
557 B
Go

package chasm
// CoreLibrary contains built-in components maintained as part of the CHASM framework.
type CoreLibrary struct {
UnimplementedLibrary
}
func (b *CoreLibrary) Name() string {
return "core"
}
func (b *CoreLibrary) Components() []*RegistrableComponent {
return []*RegistrableComponent{
NewRegistrableComponent[*Visibility]("vis"),
}
}
func (b *CoreLibrary) Tasks() []*RegistrableTask {
return []*RegistrableTask{
NewRegistrableSideEffectTask(
"visTask",
defaultVisibilityTaskHandler,
defaultVisibilityTaskHandler,
),
}
}