Skip to content
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

Remove experimental_ prefix from filter #46406

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
/**
* Filter
*/
experimental_filter: {process: processFilter},
filter: {process: processFilter},

/**
* MixBlendMode
Expand All @@ -135,7 +135,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
/*
* BoxShadow
*/
experimental_boxShadow: {process: processBoxShadow},
boxShadow: {process: processBoxShadow},

/**
* Linear Gradient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ const validAttributesForNonEventProps = {
experimental_backgroundImage: {
process: require('../StyleSheet/processBackgroundImage').default,
},
experimental_boxShadow: {
boxShadow: {
process: require('../StyleSheet/processBoxShadow').default,
},
experimental_filter: {
filter: {
process: require('../StyleSheet/processFilter').default,
},
experimental_mixBlendMode: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ const validAttributesForNonEventProps = {
hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
collapsable: true,
collapsableChildren: true,
experimental_filter: {
filter: {
process: require('../StyleSheet/processFilter').default,
},
experimental_boxShadow: {
boxShadow: {
process: require('../StyleSheet/processBoxShadow').default,
},
experimental_mixBlendMode: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
isolation?: 'auto' | 'isolate' | undefined;
cursor?: CursorValue | undefined;
boxShadow?: ReadonlyArray<BoxShadowPrimitive> | string | undefined;
filter?: ReadonlyArray<FilterFunction> | string | undefined;
}

export type FontVariant =
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
elevation?: number,
pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
cursor?: CursorValue,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
experimental_filter?: $ReadOnlyArray<FilterFunction> | string,
boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
filter?: $ReadOnlyArray<FilterFunction> | string,
experimental_mixBlendMode?: ____BlendMode_Internal,
experimental_backgroundImage?: $ReadOnlyArray<GradientValue> | string,
isolation?: 'auto' | 'isolate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8357,8 +8357,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
elevation?: number,
pointerEvents?: \\"auto\\" | \\"none\\" | \\"box-none\\" | \\"box-only\\",
cursor?: CursorValue,
experimental_boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
experimental_filter?: $ReadOnlyArray<FilterFunction> | string,
boxShadow?: $ReadOnlyArray<BoxShadowPrimitive> | string,
filter?: $ReadOnlyArray<FilterFunction> | string,
experimental_mixBlendMode?: ____BlendMode_Internal,
experimental_backgroundImage?: $ReadOnlyArray<GradientValue> | string,
isolation?: \\"auto\\" | \\"isolate\\",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/React/Views/RCTViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,14 @@ - (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTVie
// filtered by view configs.
}

RCT_CUSTOM_VIEW_PROPERTY(experimental_filter, NSArray *, RCTView)
RCT_CUSTOM_VIEW_PROPERTY(filter, NSArray *, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
// filtered by view configs.
}

RCT_CUSTOM_VIEW_PROPERTY(experimental_boxShadow, NSArray *, RCTView)
RCT_CUSTOM_VIEW_PROPERTY(boxShadow, NSArray *, RCTView)
{
// Property is only to be used in the new renderer.
// It is necessary to add it here, otherwise it gets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public object ViewProps {
public const val BORDER_START_COLOR: String = "borderStartColor"
public const val BORDER_END_COLOR: String = "borderEndColor"
public const val ON_LAYOUT: String = "onLayout"
public const val BOX_SHADOW: String = "experimental_boxShadow"
public const val FILTER: String = "experimental_filter"
public const val BOX_SHADOW: String = "boxShadow"
public const val FILTER: String = "filter"
public const val MIX_BLEND_MODE: String = "experimental_mixBlendMode"
public const val TRANSFORM: String = "transform"
public const val TRANSFORM_ORIGIN: String = "transformOrigin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ BaseViewProps::BaseViewProps(
: convertRawProp(
context,
rawProps,
"experimental_boxShadow",
"boxShadow",
sourceProps.boxShadow,
{})),
filter(
CoreFeatures::enablePropIteratorSetter ? sourceProps.filter
: convertRawProp(
context,
rawProps,
"experimental_filter",
"filter",
sourceProps.filter,
{})),
backgroundImage(
Expand Down Expand Up @@ -346,8 +346,8 @@ void BaseViewProps::setProp(
RAW_SET_PROP_SWITCH_CASE_BASIC(removeClippedSubviews);
RAW_SET_PROP_SWITCH_CASE_BASIC(experimental_layoutConformance);
RAW_SET_PROP_SWITCH_CASE_BASIC(cursor);
RAW_SET_PROP_SWITCH_CASE(filter, "experimental_filter");
RAW_SET_PROP_SWITCH_CASE(boxShadow, "experimental_boxShadow");
RAW_SET_PROP_SWITCH_CASE(filter, "filter");
RAW_SET_PROP_SWITCH_CASE(boxShadow, "boxShadow");
// events field
VIEW_EVENT_CASE(PointerEnter);
VIEW_EVENT_CASE(PointerEnterCapture);
Expand Down
5 changes: 0 additions & 5 deletions packages/react-native/types/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ declare module '.' {
}

export interface ViewStyle {
experimental_boxShadow?:
| ReadonlyArray<BoxShadowPrimitive>
| string
| undefined;
experimental_filter?: ReadonlyArray<FilterFunction> | string | undefined;
experimental_mixBlendMode?: BlendMode | undefined;
experimental_backgroundImage?:
| ReadonlyArray<GradientValue>
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/js/components/RNTPressableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const styles = StyleSheet.create({
paddingVertical: 16,
marginVertical: 5,
marginHorizontal: 16,
experimental_boxShadow: '0 2px 4px -1px rgba(0, 0, 0, 0.25)',
boxShadow: '0 2px 4px -1px rgba(0, 0, 0, 0.25)',
borderRadius: 8,
},
descriptionText: {
Expand Down
42 changes: 12 additions & 30 deletions packages/rn-tester/js/examples/Filter/FilterExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ exports.examples = [
render(): React.Node {
return (
<StaticViewAndImage
style={{experimental_filter: [{brightness: 1.5}]}}
style={{filter: [{brightness: 1.5}]}}
testID="filter-test-brightness"
/>
);
Expand All @@ -118,9 +118,7 @@ exports.examples = [
description: 'opacity(0.5)',
name: 'opacity',
render(): React.Node {
return (
<StaticViewAndImage style={{experimental_filter: [{opacity: 0.5}]}} />
);
return <StaticViewAndImage style={{filter: [{opacity: 0.5}]}} />;
},
},
{
Expand All @@ -129,9 +127,7 @@ exports.examples = [
name: 'contrast',
platform: 'android',
render(): React.Node {
return (
<StaticViewAndImage style={{experimental_filter: [{contrast: 0.5}]}} />
);
return <StaticViewAndImage style={{filter: [{contrast: 0.5}]}} />;
},
},
{
Expand All @@ -140,9 +136,7 @@ exports.examples = [
name: 'sepia',
platform: 'android',
render(): React.Node {
return (
<StaticViewAndImage style={{experimental_filter: [{sepia: 0.5}]}} />
);
return <StaticViewAndImage style={{filter: [{sepia: 0.5}]}} />;
},
},
{
Expand All @@ -151,9 +145,7 @@ exports.examples = [
name: 'grayscale',
platform: 'android',
render(): React.Node {
return (
<StaticViewAndImage style={{experimental_filter: [{grayscale: 0.5}]}} />
);
return <StaticViewAndImage style={{filter: [{grayscale: 0.5}]}} />;
},
},
{
Expand All @@ -162,9 +154,7 @@ exports.examples = [
name: 'saturate',
platform: 'android',
render(): React.Node {
return (
<StaticViewAndImage style={{experimental_filter: [{saturate: 4}]}} />
);
return <StaticViewAndImage style={{filter: [{saturate: 4}]}} />;
},
},
{
Expand All @@ -173,11 +163,7 @@ exports.examples = [
name: 'hueRotate',
platform: 'android',
render(): React.Node {
return (
<StaticViewAndImage
style={{experimental_filter: [{hueRotate: '-90deg'}]}}
/>
);
return <StaticViewAndImage style={{filter: [{hueRotate: '-90deg'}]}} />;
},
},
{
Expand All @@ -186,9 +172,7 @@ exports.examples = [
name: 'invert',
platform: 'android',
render(): React.Node {
return (
<StaticViewAndImage style={{experimental_filter: [{invert: 0.7}]}} />
);
return <StaticViewAndImage style={{filter: [{invert: 0.7}]}} />;
},
},
{
Expand All @@ -199,7 +183,7 @@ exports.examples = [
render(): React.Node {
return (
<StaticViewAndImage
style={{experimental_filter: [{blur: 10}]}}
style={{filter: [{blur: 10}]}}
testID="filter-test-blur"
/>
);
Expand All @@ -214,7 +198,7 @@ exports.examples = [
return (
<StaticViewAndImage
style={{
experimental_filter: [{dropShadow: '30px 10px 4px #4444dd'}],
filter: [{dropShadow: '30px 10px 4px #4444dd'}],
}}
testID="filter-test-drop-shadow"
imageSource={alphaHotdog}
Expand All @@ -229,7 +213,7 @@ exports.examples = [
render(): React.Node {
return (
<StaticViewAndImageWithState
style={{experimental_filter: [{brightness: 1.5}, {opacity: 0.5}]}}
style={{filter: [{brightness: 1.5}, {opacity: 0.5}]}}
testID="filter-test-chain"
/>
);
Expand All @@ -240,9 +224,7 @@ exports.examples = [
description: 'Turn brightness(1.5) on and off every 5 seconds',
render(): React.Node {
return (
<StaticViewAndImageWithState
style={{experimental_filter: [{brightness: 1.5}]}}
/>
<StaticViewAndImageWithState style={{filter: [{brightness: 1.5}]}} />
);
},
},
Expand Down
6 changes: 3 additions & 3 deletions packages/rn-tester/js/examples/Image/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,10 +826,10 @@ const styles = StyleSheet.create({
},
boxShadowWithBackground: {
backgroundColor: 'lightblue',
experimental_boxShadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.5)',
boxShadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.5)',
},
boxShadowMultiOutsetInset: {
experimental_boxShadow:
boxShadow:
'-5px -5px 10px 2px rgba(0, 128, 0, 0.5), 5px 5px 10px 2px rgba(128, 0, 0, 0.5), inset orange 0px 0px 20px 0px, black 0px 0px 5px 1px',
borderColor: 'blue',
borderWidth: 1,
Expand All @@ -842,7 +842,7 @@ const styles = StyleSheet.create({
borderBottomLeftRadius: 20,
marginRight: 80,
marginTop: 40,
experimental_boxShadow: '80px 0px 10px 0px hotpink',
boxShadow: '80px 0px 10px 0px hotpink',
transform: 'rotate(-15deg)',
},
vectorDrawableRow: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ examples.push(
<LayeredView
style={{
experimental_mixBlendMode: 'luminosity',
experimental_filter: 'blur(3px)',
filter: 'blur(3px)',
}}
/>
<LayeredImage
style={{
experimental_mixBlendMode: 'difference',
experimental_filter: 'hue-rotate(90deg)',
filter: 'hue-rotate(90deg)',
}}
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/js/examples/Text/TextExample.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ const examples = [
testID="text-box-shadow"
style={{
borderRadius: 10,
experimental_boxShadow: '0 0 10px red',
boxShadow: '0 0 10px red',
}}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/js/examples/Text/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ const examples = [
testID="text-box-shadow"
style={{
borderRadius: 10,
experimental_boxShadow: '0 0 10px red',
boxShadow: '0 0 10px red',
}}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
Expand Down
14 changes: 7 additions & 7 deletions packages/rn-tester/js/examples/View/ViewExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function BoxShadowExample(): React.Node {
borderRadius: 10,
borderWidth: 5,
borderColor: 'red',
experimental_boxShadow: '0 0 10px 0 black',
boxShadow: '0 0 10px 0 black',
}}
/>
<View
Expand All @@ -473,7 +473,7 @@ function BoxShadowExample(): React.Node {
borderRadius: 30,
borderWidth: 5,
borderColor: 'red',
experimental_boxShadow: 'inset 0 0 10px 0 black',
boxShadow: 'inset 0 0 10px 0 black',
}}
/>
<View
Expand All @@ -482,7 +482,7 @@ function BoxShadowExample(): React.Node {
borderRadius: 30,
borderWidth: 5,
borderColor: 'red',
experimental_boxShadow:
boxShadow:
'inset 15px -5px 5px 5px cyan, inset 15px -5px 20px 10px orange, -5px 5px 5px 0px green, 0px -10px 0px 5px black',
}}
/>
Expand All @@ -491,7 +491,7 @@ function BoxShadowExample(): React.Node {
<View
style={{
...defaultStyleSize,
experimental_boxShadow: '0px 0px 5px 5px black',
boxShadow: '0px 0px 5px 5px black',
}}>
<View
style={{
Expand All @@ -506,15 +506,15 @@ function BoxShadowExample(): React.Node {
style={{
...defaultStyleSize,
backgroundColor: 'red',
experimental_boxShadow: 'inset 0px 0px 5px 5px black',
boxShadow: 'inset 0px 0px 5px 5px black',
}}
/>
<View style={{...defaultStyleSize, flexDirection: 'row'}}>
<View style={{width: 25, height: 25, backgroundColor: 'cyan'}} />
<View
style={{
...defaultStyleSize,
experimental_boxShadow: ' 0px 0px 20px 5px black',
boxShadow: ' 0px 0px 20px 5px black',
}}
/>
<View style={{width: 25, height: 25, backgroundColor: 'cyan'}} />
Expand All @@ -525,7 +525,7 @@ function BoxShadowExample(): React.Node {
style={{
...defaultStyleSize,
backgroundColor: 'green',
experimental_boxShadow: '0px 10px',
boxShadow: '0px 10px',
}}
/>
</View>
Expand Down
Loading