Latest release delete precomputeStyle module? #3760

Closed
jarvys opened this Issue Oct 29, 2015 · 11 comments

Comments

Projects
None yet
9 participants
@jarvys

jarvys commented Oct 29, 2015

redbox report 'unknown module precomputeStyle'

@pickhardt

This comment has been minimized.

Show comment
Hide comment
@pickhardt

pickhardt Oct 29, 2015

+1 is there a replacement for precomputeStyle?

This used to work, but now doesn't:

var precomputeStyle = require('precomputeStyle');

screen shot 2015-10-28 at 9 28 36 pm

+1 is there a replacement for precomputeStyle?

This used to work, but now doesn't:

var precomputeStyle = require('precomputeStyle');

screen shot 2015-10-28 at 9 28 36 pm

@jarvys jarvys changed the title from latest realease delete precomputeStyle module? to Latest release delete precomputeStyle module? Oct 29, 2015

@corymsmith

This comment has been minimized.

Show comment
Hide comment
@corymsmith

corymsmith Oct 29, 2015

Wondering the same thing over here

Wondering the same thing over here

@corymsmith

This comment has been minimized.

Show comment
Hide comment
@corymsmith

corymsmith Oct 29, 2015

Looks like this commit by @sebmarkbage 6244fd0#diff-459f28dd7480110d5d268af6f1204452

It was a private module so technically we shouldn't have been using it :) Is there a good alternative to use in native modules?

Looks like this commit by @sebmarkbage 6244fd0#diff-459f28dd7480110d5d268af6f1204452

It was a private module so technically we shouldn't have been using it :) Is there a good alternative to use in native modules?

@pickhardt

This comment has been minimized.

Show comment
Hide comment
@pickhardt

pickhardt Oct 29, 2015

Yeah, I know it was private, but people were using it (even though technically maybe we shouldn't have) It was useful. Is there an alternative?

Maybe it should get made into a public class method of StyleSheet, like StyleSheet.precomputeStyle

Yeah, I know it was private, but people were using it (even though technically maybe we shouldn't have) It was useful. Is there an alternative?

Maybe it should get made into a public class method of StyleSheet, like StyleSheet.precomputeStyle

@sebmarkbage

This comment has been minimized.

Show comment
Hide comment
@sebmarkbage

sebmarkbage Oct 29, 2015

Member

Why and how were you using it exactly?

It may product a result that may not be idempotent (in the mathematical sense). I.e. there may not be a public API that you can pass it to because it would be computed again.

Member

sebmarkbage commented Oct 29, 2015

Why and how were you using it exactly?

It may product a result that may not be idempotent (in the mathematical sense). I.e. there may not be a public API that you can pass it to because it would be computed again.

@pickhardt

This comment has been minimized.

Show comment
Hide comment
@pickhardt

pickhardt Oct 29, 2015

Here's an example that was using it:

skv-headless/react-native-scrollable-tab-view@c111d77#diff-c7ac8c6ffd293d4101dad4033eedd5f7

(The function setAnimationValue uses it.)

Here's an example that was using it:

skv-headless/react-native-scrollable-tab-view@c111d77#diff-c7ac8c6ffd293d4101dad4033eedd5f7

(The function setAnimationValue uses it.)

@shishircc

This comment has been minimized.

Show comment
Hide comment
@shishircc

shishircc Oct 30, 2015

I am facing same problem :) . I am also using react-native-scrollable-tab-view

I am facing same problem :) . I am also using react-native-scrollable-tab-view

@sebmarkbage

This comment has been minimized.

Show comment
Hide comment
@sebmarkbage

sebmarkbage Oct 30, 2015

Member

I think that was an invalid use of precomputeStyle. Perhaps due to a misunderstanding of the setNativeProps API. @brentvatne Could you clarify why it was needed since it was already doing that here?

var style = precomputeStyle(flattenStyle(nativeProps.style));

And is still doing it. What breaks if you just remove the call?

Member

sebmarkbage commented Oct 30, 2015

I think that was an invalid use of precomputeStyle. Perhaps due to a misunderstanding of the setNativeProps API. @brentvatne Could you clarify why it was needed since it was already doing that here?

var style = precomputeStyle(flattenStyle(nativeProps.style));

And is still doing it. What breaks if you just remove the call?

@PanJiaChen PanJiaChen referenced this issue in skv-headless/react-native-scrollable-tab-view Nov 3, 2015

Closed

the latest rn could not run #65

@blairvanderhoof

This comment has been minimized.

Show comment
Hide comment
@blairvanderhoof

blairvanderhoof Nov 7, 2015

Contributor

It also broke this popular scroll refresher component syrusakbary/react-native-refresher#14

Contributor

blairvanderhoof commented Nov 7, 2015

It also broke this popular scroll refresher component syrusakbary/react-native-refresher#14

@josmardias josmardias referenced this issue in skv-headless/react-native-scrollable-tab-view Nov 8, 2015

Closed

unkown module "precomputeStyle" #69

@urquilla

This comment has been minimized.

Show comment
Hide comment

urquilla commented Dec 3, 2015

+1

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Dec 13, 2015

Collaborator

Sorry I just saw this -- I believe the reason why I did this is very silly, you guessed it @sebmarkbage.

I didn't realize at the time that I should have used the style key for style props: setNativeProps({style: {transform: [...etc]}}).

This is probably because setNativeProps let me get away with directly passing in style properties like setNativeProps({left: 5}) for everything except transform. Of course now it is obvious to me why -- setNativeProps ran precomputeStyle on the style object passed in, which then precomputed the transform matrix. 😛

So yeah, precomputeStyle isn't needed anymore.

Collaborator

brentvatne commented Dec 13, 2015

Sorry I just saw this -- I believe the reason why I did this is very silly, you guessed it @sebmarkbage.

I didn't realize at the time that I should have used the style key for style props: setNativeProps({style: {transform: [...etc]}}).

This is probably because setNativeProps let me get away with directly passing in style properties like setNativeProps({left: 5}) for everything except transform. Of course now it is obvious to me why -- setNativeProps ran precomputeStyle on the style object passed in, which then precomputed the transform matrix. 😛

So yeah, precomputeStyle isn't needed anymore.

@brentvatne brentvatne closed this Dec 13, 2015

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.