You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The livetemplate library is replacing always-on state persistence with selective persistence via the lvt:"persist" struct tag. This is a breaking change that requires updates to examples.
Context
The
livetemplatelibrary is replacing always-on state persistence with selective persistence via thelvt:"persist"struct tag. This is a breaking change that requires updates to examples.Library PR: livetemplate/livetemplate (branch:
selective-persist)What changed in the library
WithEphemeralState()— removedlvt:"transient"— removedlvt:"persist"are serialized to SessionStore and survive page refreshMount())WithEphemeralState())Tasks
Delete redundant examples
ephemeral-counter/— redundant; no persist tags = ephemeral by defaultephemeral-todos/— redundant; regulartodos/now demonstrates the patternAdd
lvt:"persist"tags to examples with UI statetodos/(state.go) — tagSearchQuery,SortBy,CurrentPage,PageSizewithlvt:"persist"todos-progressive/— tagActiveFilterwithlvt:"persist"chat/— tagCurrentUserwithlvt:"persist"Update support files
test-all.sh— removeephemeral-counterandephemeral-todosentries (lines 39-40)README.md— removeephemeral-counter/andephemeral-todos/rows; note which examples uselvt:"persist"go.mod/go.sum— updatelivetemplatedependency to the version with this changeExamples that need no changes (correctly ephemeral)
counter, flash-messages, live-preview, login, profile-progressive, progressive-enhancement, shared-notepad, todos-components, ws-disabled, avatar-upload