forked from uber/react-vis
-
Notifications
You must be signed in to change notification settings - Fork 0
RFC Styletron strategy implemention #1
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
Open
chrisirhc
wants to merge
8
commits into
modernize
Choose a base branch
from
styletron
base: modernize
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a501660
add styletron, update deps
chrisirhc c97d384
prep showcase for using styletron
chrisirhc 56259de
first style moved into styletron
chrisirhc f8ca481
iteration 2
chrisirhc d48aacd
co-locate classname with component but this adds hooks overhead and a…
chrisirhc 48a34dc
iteration 3 to retain most co-locate the className
chrisirhc 1ad374f
move into styling-utils
chrisirhc 018f088
move axis line
chrisirhc 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 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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* eslint-disable camelcase */ | ||
| import {styledWithClass} from 'utils/styling-utils'; | ||
|
|
||
| const $rv_xy_plot_axis_font_color = '#6b6b76'; | ||
| const $rv_xy_plot_axis_line_color = '#e6e6e9'; | ||
| const $rv_xy_plot_axis_font_size = '11px'; | ||
| const $rv_xy_plot_tooltip_background = '#3a3a48'; | ||
| const $rv_xy_plot_tooltip_color = '#fff'; | ||
| const $rv_xy_plot_tooltip_font_size = '12px'; | ||
| const $rv_xy_plot_tooltip_border_radius = '4px'; | ||
| const $rv_xy_plot_tooltip_shadow = '0 2px 4px rgba(0, 0, 0, 0.5)'; | ||
| const $rv_xy_plot_tooltip_padding = '7px 10px'; | ||
|
|
||
| export const XYPlotInnerSvg = styledWithClass( | ||
| 'svg', | ||
| 'rv-xy-plot__inner', | ||
| { | ||
| display: 'block', | ||
| } | ||
| ); | ||
|
|
||
| export const XYPlotAxisLine = styledWithClass( | ||
| 'line', | ||
| 'rv-xy-plot__axis__line', | ||
| { | ||
| fill: 'none', | ||
| strokeWidth: '2px', | ||
| stroke: $rv_xy_plot_axis_line_color, | ||
| } | ||
| ); |
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
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
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
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
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.
It would be interesting to take a deep dive on the performance between hooks and nested components.
This is the component tree using the method that you have above

Changing it to use
useStyletronwith thiswe can get the component tree to look like

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.
as a point of reference, these are the hooks that are being used
