-
Notifications
You must be signed in to change notification settings - Fork 81
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
Implement/improve nav() API by implementing in Python instead of React/JSX #136
Merged
Conversation
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
cpsievert
force-pushed
the
server-side-navs
branch
2 times, most recently
from
April 25, 2022 20:00
5310a0b
to
ca38ac1
Compare
cpsievert
force-pushed
the
server-side-navs
branch
2 times, most recently
from
April 26, 2022 19:36
ecbe0af
to
bfdc2e9
Compare
This way others can create their own custom nav item classes
cpsievert
force-pushed
the
server-side-navs
branch
from
April 26, 2022 20:58
f228178
to
0bec791
Compare
…ith a tagify() method (so we can add other useful methods in the future); add a tagify() method to Nav/NavMenu as well that raises informative error
cpsievert
changed the title
Switch from React/JSX to Python for constructing nav() markup
Implement/improve nav() API by implementing in Python instead of React/JSX
Apr 27, 2022
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.
After investigating what the
nav()
API implementation would look like in JSX and web components, it seems better to just implement it in Python, for a few different reasons:There are at least a couple known cases where putting HTML inside JSX leads to different/undefined behavior, which is really unfortunate if the end user is not aware the function they're using wraps a JSX component.
Compared to what we have in R, a significant amount of complexity can be avoided by: assuming Bootstrap 5+, using an object oriented approach, and having proper type hinting (will also help help users know about mistakes in their code without making a bunch of run-time checks)
TODO:
navs_*()
tonavset_*()
(andNavsArg
toNavSetArg
)?nav_content()
nav_item()
->nav_control()