-
-
Notifications
You must be signed in to change notification settings - Fork 323
Subcomponent notation #1285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Archmonger
merged 13 commits into
reactive-python:develop
from
shawncrawley:subcomponent-notation
Mar 26, 2025
Merged
Subcomponent notation #1285
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0b41dc9
Adds support for web module subcomponent notation
shawncrawley d311e6a
Adds object-based subcomponent accessor and tests
shawncrawley 5412757
Fixes linter/formatting errors
shawncrawley 7923573
Remove whitespace
shawncrawley ffdb041
More formatting fixes
shawncrawley b3063ba
Another linter fix
shawncrawley 11303f8
Addresses feedback by @Archmonger
shawncrawley 8f4bfcc
Fixes typo
shawncrawley 25d1921
Swap unpkg for esm to fix failing tests
shawncrawley bddc027
Revert last commit - restore unpkg
shawncrawley 1c6fe43
Tweak test to wait for attached, not visible
shawncrawley 9dd55cf
Fixes failing tests
shawncrawley efb9f88
Temporarily disable JS tests
Archmonger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "https://esm.sh/[email protected]" | ||
import ReactDOM from "https://esm.sh/[email protected]/client" | ||
import {InputGroup, Form} from "https://esm.sh/[email protected][email protected],[email protected],[email protected]&exports=InputGroup,Form"; | ||
export {InputGroup, Form}; | ||
|
||
export function bind(node, config) { | ||
const root = ReactDOM.createRoot(node); | ||
return { | ||
create: (type, props, children) => | ||
React.createElement(type, props, ...children), | ||
render: (element) => root.render(element), | ||
unmount: () => root.unmount() | ||
}; | ||
} |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this variable name makes much sense. Shouldn't it be something like
rootPackageName
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used
rootType
since this the variable two lines above istype
- which refers to the type of Element (i.e. Component) being created. But I went ahead and changed this anyway. In fact, I decided to somewhat refactor thecreateImportSourceElement
function to move a bit more logic into thegetComponentFromModule
function (renamed fromtryGetSubType
, as you requested below). Have a look at it now and see if the logic flows well.