Skip to content

Commit

Permalink
Correct Render<E> method signature argument order (#814)
Browse files Browse the repository at this point in the history
* Correct `Render<E>` method signature argument order

Closes [#812][]

The order of the arguments in the `Render` signature are incorrect, and
[were introduced in that incorrect order][incorrect].

Luckily, the default implementations and the tests that exercise that
feature are in the correct order.

The signature's argument order was inspired by
[morphdom's](https://github.com/patrick-steele-idem/morphdom#usage),
with the latter argument serving as overrides for the prior argument.

Custom rendering isn't yet covered by Turbo's documentation website, so
we have an opportunity to document it thoroughly and correctly, starting
with TypeScript's understanding of the interface.

[#812]: #812
[incorrect]: https://github.com/hotwired/turbo/pull/431/files#diff-d554b20c605a72c68b2d429ff9915cca4afa8e118026f56ede93382d130382a7R11

* Update `@playwright/test` dependency

Our [CI][] is currently failing while executing `yarn run playwright
install --with-deps`.

This commit updates the dependency in an effort to resolve whatever
underlying dependency issues are causing the failure.

[CI]: https://github.com/hotwired/turbo/actions/runs/3664875382/jobs/6195570624#step:6:1
  • Loading branch information
seanpdoyle authored Dec 23, 2022
1 parent e5c9019 commit 77d93d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type ResolvingFunctions<T = unknown> = {
reject(reason?: any): void
}

export type Render<E> = (newElement: E, currentElement: E) => void
export type Render<E> = (currentElement: E, newElement: E) => void

export abstract class Renderer<E extends Element, S extends Snapshot<E> = Snapshot<E>> implements BardoDelegate {
readonly currentSnapshot: S
Expand Down

0 comments on commit 77d93d4

Please sign in to comment.