dynamic html tag. html_options{tag:span} Wrapper component in SPAN #480#1208
dynamic html tag. html_options{tag:span} Wrapper component in SPAN #480#1208justin808 merged 12 commits intoshakacode:masterfrom
Conversation
justin808
left a comment
There was a problem hiding this comment.
Needs unit tests
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @tahsin352)
CHANGELOG.md, line 20 at r1 (raw file):
### [11.2.3] - 2019-04-08 #### Improved - html_options can now has option for 'tag' to add dynamically html element. like this : html_options{tag:'span'}.
html_options supports 'tag' to dynamically set the HTML tag rather than using the default of DIV. html_options{ tag: 'span' }
lib/react_on_rails/helper.rb, line 346 at r1 (raw file):
content_tag_options.delete("tag") else content_tag_options_html_tag = div
:div
update to latest
… chromedriver-helper is depricated now. instead we use webdrivers.
|
CI is failing: |
justin808
left a comment
There was a problem hiding this comment.
Reviewed 1 of 3 files at r2, 3 of 3 files at r3.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @tahsin352)
CHANGELOG.md, line 20 at r3 (raw file):
### [11.2.3] - 2019-04-08 #### Improved - html_options can now has option for 'tag' to add dynamically html element. like this : html_options{tag:'span'}.
There's a pattern for the below entries.
lib/react_on_rails/helper.rb, line 342 at r3 (raw file):
) content_tag_options = render_options.html_options logger.debug content_tag_options[:tag]
- We generally use parens
- logger.debug why?
- logger.debug { some_expression } won't evaluate the expression unless debug mode.
spec/dummy/spec/helpers/react_on_rails_helper_spec.rb, line 249 at r3 (raw file):
subject { react_component("App", html_options: { tag: "span" }) } it { is_expected.to include "span" }
can we have a test where this option is not present and verify we get div?
justin808
left a comment
There was a problem hiding this comment.
I gave some suggestions.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @tahsin352)
justin808
left a comment
There was a problem hiding this comment.
Reviewable status: 3 of 5 files reviewed, 11 unresolved discussions (waiting on @justin808 and @tahsin352)
CHANGELOG.md, line 20 at r3 (raw file):
Previously, justin808 (Justin Gordon) wrote…
There's a pattern for the below entries.
@tahsin352 Please conform to the style of the entries below.
CHANGELOG.md, line 19 at r4 (raw file):
*Please add entries here for your pull requests that are not yet released.* ### [11.2.3] - 2019-04-08 #### Improved
This should be Added, not Improved.
Added means that there is new functionality in that you can use a tag of span.
So we should bump the version to 11.3.0.
Generally, fixed is for X.Y.Z versions where Z changes.
https://semver.org/#spec-item-7
Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.
Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version is incremented.
Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 when major version is incremented.
CHANGELOG.md, line 31 at r4 (raw file):
Any truthy values calls hydrate rather than render. (https://github.com/shakacode/react_on_rails/pull/1159) by
this Markdown is incorrect.
CHANGELOG.md, line 42 at r4 (raw file):
Thus, developers will need to fix server rendering errors before continuing. [PR 1145](https://github.com/shakacode/react_on_rails/pull/1145) by [justin808](https://github.com/justin808).
@tahsin352 this is the correct markdown
lib/react_on_rails/helper.rb, line 342 at r4 (raw file):
) content_tag_options = render_options.html_options if content_tag_options.key?(:tag)
could, should a string option of "tag" be used? rather than a symbol?
I think Ruby converts to a HashWithIndifferentAccess. Can you check?
lib/react_on_rails/helper.rb, line 350 at r4 (raw file):
content_tag_options[:id] = render_options.dom_id rendered_output = content_tag(:"#{content_tag_options_html_tag}",
Please use :to_sym rather than the : operator with an interpolated string
spec/dummy/spec/helpers/react_on_rails_helper_spec.rb, line 255 at r4 (raw file):
subject { react_component("App") } it { is_expected.to include "div" }
I'm pretty sure you'd likely have child elements that are div in both test cases.
We should add a case of not include "span"
Even better, set the id attribute and make sure that element has a tag of either span or div.
…te in rpsec. Change log updated with proper version.
justin808
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r4, 3 of 3 files at r5.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @tahsin352)
CHANGELOG.md, line 20 at r3 (raw file):
Previously, justin808 (Justin Gordon) wrote…
@tahsin352 Please conform to the style of the entries below.
OK
CHANGELOG.md, line 19 at r4 (raw file):
Previously, justin808 (Justin Gordon) wrote…
This should be
Added, notImproved.Added means that there is new functionality in that you can use a tag of span.
So we should bump the version to 11.3.0.
Generally, fixed is for X.Y.Z versions where Z changes.
https://semver.org/#spec-item-7
Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.
Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version is incremented.
Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 when major version is incremented.
OK
CHANGELOG.md, line 31 at r4 (raw file):
Previously, justin808 (Justin Gordon) wrote…
Any truthy values calls hydrate rather than render. (https://github.com/shakacode/react_on_rails/pull/1159) bythis Markdown is incorrect.
OK -- I can fix this on master
CHANGELOG.md, line 42 at r4 (raw file):
Previously, justin808 (Justin Gordon) wrote…
@tahsin352 this is the correct markdown
OK
lib/react_on_rails/helper.rb, line 342 at r3 (raw file):
Previously, justin808 (Justin Gordon) wrote…
- We generally use parens
- logger.debug why?
- logger.debug { some_expression } won't evaluate the expression unless debug mode.
OK
lib/react_on_rails/helper.rb, line 342 at r4 (raw file):
Previously, justin808 (Justin Gordon) wrote…
could, should a string option of "tag" be used? rather than a symbol?
I think Ruby converts to a HashWithIndifferentAccess. Can you check?
Did you see this question, @tahsin352?
lib/react_on_rails/helper.rb, line 350 at r4 (raw file):
Previously, justin808 (Justin Gordon) wrote…
Please use
:to_symrather than the:operator with an interpolated string
OK
spec/dummy/spec/helpers/react_on_rails_helper_spec.rb, line 249 at r3 (raw file):
Previously, justin808 (Justin Gordon) wrote…
can we have a test where this option is not present and verify we get div?
OK
spec/dummy/spec/helpers/react_on_rails_helper_spec.rb, line 255 at r4 (raw file):
Previously, justin808 (Justin Gordon) wrote…
I'm pretty sure you'd likely have child elements that are div in both test cases.
We should add a case of not include "span"Even better, set the
idattribute and make sure that element has a tag of eitherspanordiv.
OK
like react_rails, I have added html_options{tag:'span'}, i.e. dynamic html element property. by default it will use 'div'. Thanks.
This change is