These are chat archives for chandu0101/scalajs-react-components

24th
Jan 2018
Roberto Leibman
@rleibman
Jan 24 2018 18:07
@oyvindberg... hi again, it's been a while! I have some time to update my project to the latest. What's the current status of the project? where's the latest code and where is it at?
Øyvind Raddum Berg
@oyvindberg
Jan 24 2018 21:53
hey hey @rleibman , great to see you again
yeah, thats the current status still
i'll just merge it i guess, so we can progress forward
Øyvind Raddum Berg
@oyvindberg
Jan 24 2018 22:00
@abdheshkumar Higher order components are... not so easy to express right now. i'm fairly sure I hacked it into working way back, but I don't really remember how
Roberto Leibman
@rleibman
Jan 24 2018 22:01
I'm having some issues trying to do a "tech-refresh" with all new versions of stuff. The generation has some issue, hopefully I can get that figured out soon and I'll give you that pull request to apply.
Does this make any sense to you:
[error] scala.MatchError: {O}{O}{U%}process.env.NODE_ENV !== "production" ? { {U%}centerRipple: {O}{O}{U%}_propTypes2.default.bool, {U%}children: {O}{O}{U%}_propTypes2.default.node, {U%}containerElement: {O}{O}{O}{U%}_propTypes2.default.oneOfType([{O}{O}{U%}_propTypes2.default.string, {O}{O}{U%}_propTypes2.default.element]), {U%}disableFocusRipple: {O}{O}{U%}_propTypes2.default.bool, {U%}disableKeyboardFocus: {O}{O}{U%}_propTypes2.default.bool, {U%}disableTouchRipple: {O}{O}{U%}_propTypes2.default.bool, {U%}disabled: {O}{O}{U%}_propTypes2.default.bool, {U%}focusRippleColor: {O}{O}{U%}_propTypes2.default.string, {U%}focusRippleOpacity: {O}{O}{U%}_propTypes2.default.number, {U%}href: {O}{O}{U%}_propTypes2.default.string, {U%}keyboardFocused: {O}{O}{U%}_propTypes2.default.bool, {U%}onBlur: {O}{O}{U%}_propTypes2.default.func, {U%}onClick: {O}{O}{U%}_propTypes2.default.func, {U%}onFocus: {O}{O}{U%}_propTypes2.default.func, {U%}onKeyDown: {O}{O}{U%}_propTypes2.default.func, {U%}onKeyUp: {O}{O}{U%}_propTypes2.default.func, {U%}onKeyboardFocus: {O}{O}{U%}_propTypes2.default.func, {U%}style: {O}{O}{U%}_propTypes2.default.object, {U%}tabIndex: {O}{O}{U%}_propTypes2.default.number, {U%}touchRippleColor: {O}{O}{U%}_propTypes2.default.string, {U%}touchRippleOpacity: {O}{O}{U%}_propTypes2.default.number, {U%}type: {O}{O}{U%}_propTypes2.default.string } : {} (of class jdk.nashorn.internal.ir.TernaryNode)
[error]     at com.olvind.requiresjs.VisitorComponents.enterBinaryNode(VisitorComponents.scala:38)
[error]     at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:335)
[error]     at jdk.nashorn.internal.ir.ExpressionStatement.accept(ExpressionStatement.java:64)
[error]     at jdk.nashorn.internal.ir.Node.accept(Node.java:271)
[error]     at jdk.nashorn.internal.ir.Block.accept(Block.java:185)
[error]     at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
[error]     at jdk.nashorn.internal.ir.Block.accept(Block.java:439)
[error]     at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:336)
[e
Roberto Leibman
@rleibman
Jan 24 2018 23:34
*Note on the above: the missing case happens to be a "TernaryNode", i.e. it doesn't match ObjectNode or IdentNode
Øyvind Raddum Berg
@oyvindberg
Jan 24 2018 23:36
i always used the debugger to inspect the trees
this looks fairly straightforward to handle, I'm sure you can match on the predicate to see that it tests for production, and choose the production branch
err, choose the development branch - i guess they don't include propTypes in prod mode
Roberto Leibman
@rleibman
Jan 24 2018 23:50
eek! working on the syntax tree is gnarly!
Øyvind Raddum Berg
@oyvindberg
Jan 24 2018 23:51
the tree itself isn't that bad, but the lack of extractors is infuriating
Roberto Leibman
@rleibman
Jan 24 2018 23:52
Ha, yeah!
Øyvind Raddum Berg
@oyvindberg
Jan 24 2018 23:53
if we were to write a lot of that code it would have been worthwhile to write them manually