Conversation
✅ Deploy Preview for anywidget canceled.
|
Codecov Report
@@ Coverage Diff @@
## main #138 +/- ##
=======================================
Coverage 97.14% 97.14%
=======================================
Files 8 8
Lines 420 420
=======================================
Hits 408 408
Misses 12 12 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
domoritz
approved these changes
Jun 14, 2023
| /** | ||
| * @typedef AnyWidgetModule | ||
| * @prop render {(view: WidgetView) => Promise<undefined | (() => Promise<void>)>} | ||
| * @prop render {(view: { model: WidgetModel, el: HTMLElement }) => Promise<undefined | (() => Promise<void>)>} |
Contributor
There was a problem hiding this comment.
Is it odd that the variable is still called view here?
Owner
Author
There was a problem hiding this comment.
Ah yes, that's a good suggestion. Maybe a type like RenderContext or RenderProps would be better a more suitable type (variable names context or props respectively)
manzt
marked this pull request as ready for review
June 14, 2023 19:25
Contributor
|
This would work for my use case, too. |
Merged
This was referenced Jun 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR addresses issue #137 by making changes to object exposed to user-provided
render.Previous:
Proposed:
The key focus is on minimizing the API surface area by reducing the exposed fields to the user-provided render function. This change is expected to improve encapsulation and limit the potential for erroneous modifications.
In a review of current projects utilizing anywidget, no evident use-cases were identified that would be adversely affected by this change. It's worth mentioning that there's still a degree of uncertainty about how these changes will impact model (un)subscriptions within Backbone.
To-Do:
Request for Review:
I would like to invite reviewers to provide feedback, especially in areas related to Backbone's model (un)subscriptions. Any objections or observations on potential impacts are greatly appreciated.
cc: @maartenbreddels @juba @domoritz @kolibril13