Skip to content

Commit

Permalink
Remove & add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Feb 26, 2024
1 parent 6f962bd commit 4b1f3f8
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/core/drive/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export class Navigator {
}

proposeVisit(location, options = {}) {
console.log(`proposeVisit ${location}`, options)
if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {
this.delegate.visitProposedToLocation(location, options)
}
Expand Down Expand Up @@ -70,7 +69,6 @@ export class Navigator {
}

async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {
console.log(`formSubmissionSucceededWithResponse`)
if (formSubmission == this.formSubmission) {
const responseHTML = await fetchResponse.responseHTML
if (responseHTML) {
Expand All @@ -82,14 +80,12 @@ export class Navigator {
const { statusCode, redirected } = fetchResponse
const action = this.#getActionForFormSubmission(formSubmission, fetchResponse)
const replaceMethod = this.#getReplaceMethodForFormSubmission(formSubmission, fetchResponse)
console.log(`action = ${action} and replaceMethod = ${replaceMethod}`)
const visitOptions = {
action,
replaceMethod,
shouldCacheSnapshot,
response: { statusCode, responseHTML, redirected }
}
console.log(`calling proposeVisit from formSubmission`)
this.proposeVisit(fetchResponse.location, visitOptions)
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/core/drive/page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class PageView extends View {

renderPage(snapshot, isPreview = false, willRender = true, visit) {
const shouldMorphPage = this.shouldMorphPage(snapshot, visit)
console.log(`should morph? ${shouldMorphPage}`)
const rendererClass = shouldMorphPage ? MorphRenderer : PageRenderer

const renderer = new rendererClass(this.snapshot, snapshot, PageRenderer.renderElement, isPreview, willRender)
Expand Down Expand Up @@ -57,7 +56,6 @@ export class PageView extends View {
}

shouldMorphPage(snapshot, visit) {
console.log(`shouldMorphPage snapshot? ${snapshot.shouldMorphPage}... ${visit.action} and ${visit.replaceMethod}`)
return snapshot.shouldMorphPage &&
(this.isPageRefresh(visit) || this.isReplaceMethodMorph(visit))
}
Expand Down
1 change: 1 addition & 0 deletions src/core/frames/frame_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class FrameController {
// Appearance observer delegate

elementAppearedInViewport(element) {
// TODO: Determine if I need to check replaceMethod() here — I need to find the corresponding tests
this.proposeVisitIfNavigatedWithAction(element, getVisitAction(element))
this.#loadSourceURL()
}
Expand Down
1 change: 0 additions & 1 deletion src/core/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export class Session {
const replaceMethod = this.getVisitReplaceMethodForLink(link)
const acceptsStreamResponse = link.hasAttribute("data-turbo-stream")

console.log(`followedLinkToLocation`)
this.visit(location.href, { action, replaceMethod, acceptsStreamResponse })
}

Expand Down
1 change: 1 addition & 0 deletions src/observers/form_link_click_observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class FormLinkClickObserver {
const turboFrame = link.getAttribute("data-turbo-frame")
if (turboFrame) form.setAttribute("data-turbo-frame", turboFrame)

// TODO: Determine if I need to check data-turbo-replace-method here — I need to find the corresponding tests
const turboAction = getVisitAction(link)
if (turboAction) form.setAttribute("data-turbo-action", turboAction)

Expand Down
1 change: 0 additions & 1 deletion src/tests/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ router.get("/messages", (request, response) => {
function receiveMessage(content, id, target) {
const data = renderSSEData(renderMessage(content, id, target))
for (const response of streamResponses) {
console.log("delivering message to stream", response.socket?.remotePort)
response.write(data)
}
}
Expand Down

0 comments on commit 4b1f3f8

Please sign in to comment.