Skip to content

Commit 13c073a

Browse files
cpsievertschloerke
andauthored
Remove dead InputBinding.dispose() method (#4375)
* fix: Call InputBinding.dispose() during unbinding (#2875) InputBinding.dispose() was defined but never called. Now invoked after unsubscribe and the shiny:unbound event in unbindInputs(). Also fixes the comment that incorrectly said "output" instead of "input". * Remove InputBinding.dispose() — dead code, never called or documented Rather than wiring up the never-called dispose(), remove it entirely. The method was defined but never invoked for 6+ years, is not documented in the custom input bindings article, and unsubscribe() already serves as the teardown hook. * Add NEWS entry for InputBinding.dispose() removal * Apply suggestion from @cpsievert * `npm run build` (GitHub Actions) --------- Co-authored-by: Barret Schloerke <barret@posit.co> Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
1 parent 275d939 commit 13c073a

7 files changed

Lines changed: 9 additions & 18 deletions

File tree

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
* `conditionalPanel()` no longer briefly flashes its contents on app start
1616
when the condition is initially `FALSE`. (#3505)
1717

18+
* Removed `InputBinding.dispose()` from the JavaScript `InputBinding` class.
19+
This method was never called by Shiny's runtime, so any overrides were dead
20+
code. Use `unsubscribe()` for cleanup logic instead. (#4375)
21+
1822
# shiny 1.13.0
1923

2024
## New features

inst/www/shared/shiny.js

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

srcts/src/bindings/input/inputBinding.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ class InputBinding {
8686
return;
8787
el; // eslint-disable-line @typescript-eslint/no-unused-expressions
8888
}
89-
90-
// This is called after unbinding the output.
91-
dispose(el: HTMLElement): void {
92-
//empty
93-
return;
94-
el; // eslint-disable-line @typescript-eslint/no-unused-expressions
95-
}
9689
}
9790

9891
//// NOTES FOR FUTURE DEV

srcts/types/src/bindings/input/inputBinding.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ declare class InputBinding {
2020
delay: number;
2121
} | null;
2222
initialize(el: HTMLElement): void;
23-
dispose(el: HTMLElement): void;
2423
}
2524
export { InputBinding };
2625
export type { InputSubscribeCallback, SubscribeEventPriority };

0 commit comments

Comments
 (0)