Watch for changes and run tests during development using grunt watch. #117

Merged
paramaggarwal merged 1 commits from watch into master 2015-08-28 09:49:46 -07:00
paramaggarwal commented 2015-08-28 09:48:39 -07:00 (Migrated from github.com)

In development, watch for changes to src/Layout.js and keep running tests whenever the file changes. Helps to ensure that a breaking change is not introduced while developing.

In development, watch for changes to `src/Layout.js` and keep running tests whenever the file changes. Helps to ensure that a breaking change is not introduced while developing.
paramaggarwal commented 2015-08-28 09:58:23 -07:00 (Migrated from github.com)

That was fast! Thanks @vjeux. (Please also bless https://github.com/facebook/react-native/pull/1776! 😛)

That was fast! Thanks @vjeux. (Please also bless https://github.com/facebook/react-native/pull/1776! :stuck_out_tongue:)
vjeux commented 2015-08-28 10:00:54 -07:00 (Migrated from github.com)

Yeah so sorry about this, I want to do a proper review of aspectRatio and merge it but I kept putting it to the next day :(

Yeah so sorry about this, I want to do a proper review of aspectRatio and merge it but I kept putting it to the next day :(
paramaggarwal commented 2015-08-28 10:04:35 -07:00 (Migrated from github.com)

https://github.com/facebook/react-native/pull/1776 is the tiny css-layout change that was needed to allow the children of a measure function based node to also be laid out.

Regarding the aspectRatio PR, I am looking at how to make aspectRatio work horizontally too. Currently because measure only works one way (given width, it calculates height) the aspectRatio also works in just one direction. To be able to use aspectRatio such that given a height, it would calculate the width to maintain ratio, we need to make measure more generic.

Any idea how to make measure take both width and height, so that it can work both ways?

https://github.com/facebook/react-native/pull/1776 is the tiny css-layout change that was needed to allow the children of a `measure` function based node to also be laid out. Regarding the `aspectRatio` PR, I am looking at how to make aspectRatio work horizontally too. Currently because `measure` only works one way (given width, it calculates height) the `aspectRatio` also works in just one direction. To be able to use `aspectRatio` such that given a height, it would calculate the width to maintain ratio, we need to make `measure` more generic. Any idea how to make `measure` take both width and height, so that it can work both ways?
vjeux commented 2015-08-28 10:07:34 -07:00 (Migrated from github.com)

Oh interesting. Yeah would be nice. You should look at sizeThatFits and layoutSubviews in iOS. It has proven to be a good abstraction to implement "hard" layouts. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/instm/UIView/sizeThatFits:

Oh interesting. Yeah would be nice. You should look at sizeThatFits and layoutSubviews in iOS. It has proven to be a good abstraction to implement "hard" layouts. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/instm/UIView/sizeThatFits:
ColinEberhardt commented 2015-08-28 10:10:24 -07:00 (Migrated from github.com)

Thanks for the contribution to the build :-)

Quick question - is there any reason the watch runs the ci task rather than the build task? (See the comments that describe the difference)

Thanks for the contribution to the build :-) Quick question - is there any reason the watch runs the ci task rather than the build task? (See the comments that describe the difference)
paramaggarwal commented 2015-08-28 10:11:09 -07:00 (Migrated from github.com)

@ColinEberhardt The build task would cause Chrome to keep opening again and again while developing. This is more like continuous integration if you think about it.

@ColinEberhardt The `build` task would cause Chrome to keep opening again and again while developing. This is more like continuous integration if you think about it.
paramaggarwal commented 2015-08-28 10:13:57 -07:00 (Migrated from github.com)

@vjeux The sizeThatFits API looks nice. It takes a CGSize as input - pretty much what we need for our generic measure function in css-layout. Currently measure only takes width - hence the limitation.

Just need to modify css-layout to let measure take a width and a height and then set layout properties based on the returned value.

@vjeux The `sizeThatFits` API looks nice. It takes a `CGSize` as input - pretty much what we need for our generic `measure` function in css-layout. Currently `measure` only takes `width` - hence the limitation. Just need to modify css-layout to let `measure` take a width _and_ a height and then set layout properties based on the returned value.
ColinEberhardt commented 2015-08-28 10:20:26 -07:00 (Migrated from github.com)

@paramaggarwal fair enough, I guess that would be quite disruptive.

@paramaggarwal fair enough, I guess that would be quite disruptive.
Sign in to join this conversation.
No description provided.