Skip to content

Commit

Permalink
Add support for only rendering html fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
marschall committed Jul 6, 2024
1 parent 3074c69 commit dd91bf6
Show file tree
Hide file tree
Showing 24 changed files with 99 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am a component that is used to render a web page without a head and a body.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
updating
updateRoot: anHtmlRoot
self shouldNotImplement
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "Anonymous 7/6/2024 13:02",
"super" : "WAComponent",
"category" : "Seaside-Component-Base",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAHeadlessComponent",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
SystemOrganization addCategory: #'Seaside-Component'!
SystemOrganization addCategory: #'Seaside-Component-Base'!
SystemOrganization addCategory: #'Seaside-Component-Exceptions'!
SystemOrganization addCategory: #'Seaside-Component-Tasks'!
SystemOrganization addCategory: #'Seaside-Component-Visitors'!
self packageOrganizer ensurePackage: #'Seaside-Component' withTags: #(#Base #Exceptions #Tasks #Visitors)!
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am a stand in for an HTML root to render a web page without head or body.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
writing
closeOn: aDocument
"intentionally empty"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
writing
openOn: aDocument
"intentionally empty"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "Anonymous 7/6/2024 13:07",
"super" : "WAObject",
"category" : "Seaside-Core-Document",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WANilHtmlRoot",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I am a render phase continuation that only renders a fragment of a web page, without a head or body.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
private
createHtmlRootWithContext: aRenderContext
^ WANilHtmlRoot new
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
updating
updateRoot: anHtmlRoot
"intentionally empty"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "Anonymous 7/6/2024 13:05",
"super" : "WARenderPhaseContinuation",
"category" : "Seaside-RenderLoop-Continuations",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAFragmentRenderPhaseContinuation",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
SystemOrganization addCategory: #'Seaside-RenderLoop'!
SystemOrganization addCategory: #'Seaside-RenderLoop-Base'!
SystemOrganization addCategory: #'Seaside-RenderLoop-Continuations'!
SystemOrganization addCategory: #'Seaside-RenderLoop-Errors'!
self packageOrganizer ensurePackage: #'Seaside-RenderLoop' withTags: #(#Base #Continuations #Errors)!
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests
as yet unclassified
testNotImplemented
| context request |
#('OPTIONS' 'HEAD' 'PUT' 'DELETE' 'TRACE' 'CONNECT') do: [ :each |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests
as yet unclassified
testPathConsumption
| context request |
request := self requestWithMethod: 'GET'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests
as yet unclassified
testPreFetchIsForbidden
| context request |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests
as yet unclassified
testUrlFor
| context request response session url |
handler class == WARegistry "only WARegistry supports tracking generic request handlers"
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
shouldInheritSelectors
^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
private
newHandler
| application |
application := WAApplication new.
application configuration
addParent: WARenderLoopConfiguration instance.
^ application
rootClass: WACounter;
preferenceAt: #renderPhaseContinuationClass put: WAFragmentRenderPhaseContinuation;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
running
requestWithMethod: aString
^ WARequest
method: aString
uri: '/app/oneo'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests
testRendering
| context request responseContents |
request := self requestWithMethod: 'GET'.
context := WARequestContext request: request response: WABufferedResponse new.
[ handler handle: context ]
on: WAResponseNotification
do: [ :notification | ].
self assert: context response status = 200.
responseContents := context response contents.
self assert: (responseContents beginsWith: '<h1>').
self assert: (responseContents endsWith: '</a>')
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "WARequestHandlerTest",
"category" : "Seaside-Tests-Session",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAFragmentRenderingTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SystemOrganization addCategory: #'Seaside-Tests-Session'!
self packageOrganizer ensurePackage: #'Seaside-Tests-Session' withTags: #()!

0 comments on commit dd91bf6

Please sign in to comment.