From 456d54a456b32919da4ad80b92ad0118246db7ea Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Wed, 27 Nov 2024 21:58:23 +0100 Subject: [PATCH] set turbo-prefetch to false per default for Seaside since callbacks modify state server-side and should not be prefetched --- .../WAMetaElement.class/instance/turboPrefetch..st | 7 +++++++ .../instance/updateRoot..st | 5 +++++ .../WATurboMultiCounter.class/class/register.st | 3 ++- .../WATurboTodo.class/class/register.st | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 repository/Seaside-Core.package/WAMetaElement.class/instance/turboPrefetch..st create mode 100644 repository/Seaside-HotwireTurbo-Core.package/WATurboRenderPhaseContinuation.class/instance/updateRoot..st diff --git a/repository/Seaside-Core.package/WAMetaElement.class/instance/turboPrefetch..st b/repository/Seaside-Core.package/WAMetaElement.class/instance/turboPrefetch..st new file mode 100644 index 000000000..66640a5d0 --- /dev/null +++ b/repository/Seaside-Core.package/WAMetaElement.class/instance/turboPrefetch..st @@ -0,0 +1,7 @@ +attributes +turboPrefetch: aString + "Prefetching links is enabled by default since Turbo v8, + but you can disable it by adding this meta tag to your page with value false." + + self name: 'turbo-prefetch'. + self content: aString \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo-Core.package/WATurboRenderPhaseContinuation.class/instance/updateRoot..st b/repository/Seaside-HotwireTurbo-Core.package/WATurboRenderPhaseContinuation.class/instance/updateRoot..st new file mode 100644 index 000000000..d8f79b38d --- /dev/null +++ b/repository/Seaside-HotwireTurbo-Core.package/WATurboRenderPhaseContinuation.class/instance/updateRoot..st @@ -0,0 +1,5 @@ +updating +updateRoot: aRoot + + super updateRoot: aRoot. + aRoot meta turboPrefetch: 'false' \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo-Examples.package/WATurboMultiCounter.class/class/register.st b/repository/Seaside-HotwireTurbo-Examples.package/WATurboMultiCounter.class/class/register.st index f6d439852..bfabf9c62 100644 --- a/repository/Seaside-HotwireTurbo-Examples.package/WATurboMultiCounter.class/class/register.st +++ b/repository/Seaside-HotwireTurbo-Examples.package/WATurboMultiCounter.class/class/register.st @@ -3,4 +3,5 @@ register (WAAdmin register: self asApplicationAt: '/examples/turbo/multicounter') addLibrary: JQDevelopmentLibrary; - preferenceAt: #actionPhaseContinuationClass put: WATurboCallbackProcessingActionContinuation \ No newline at end of file + preferenceAt: #actionPhaseContinuationClass put: WATurboCallbackProcessingActionContinuation; + preferenceAt: #renderPhaseContinuationClass put: WATurboRenderPhaseContinuation \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo-Examples.package/WATurboTodo.class/class/register.st b/repository/Seaside-HotwireTurbo-Examples.package/WATurboTodo.class/class/register.st index 3218caaa0..551ab4423 100644 --- a/repository/Seaside-HotwireTurbo-Examples.package/WATurboTodo.class/class/register.st +++ b/repository/Seaside-HotwireTurbo-Examples.package/WATurboTodo.class/class/register.st @@ -4,4 +4,5 @@ register (WAAdmin register: self asApplicationAt: '/examples/turbo/todo') exceptionHandler: WADebugErrorHandler; addLibrary: WAExamplesLibrary; - preferenceAt: #actionPhaseContinuationClass put: WATurboCallbackProcessingActionContinuation \ No newline at end of file + preferenceAt: #actionPhaseContinuationClass put: WATurboCallbackProcessingActionContinuation; + preferenceAt: #renderPhaseContinuationClass put: WATurboRenderPhaseContinuation \ No newline at end of file