Skip to content

fix: ci #902

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

Merged
merged 7 commits into from
Aug 1, 2025
Merged
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
19 changes: 13 additions & 6 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[version]
^0.237.2

[ignore]
; We fork some components by platform
.*/*[.]android.js
Expand All @@ -20,21 +23,24 @@ node_modules/warning/.*
; Ignore test files in resolve
.*/node_modules/resolve/test/.*

; Ignore fbjs flow weak mode
.*/node_modules/fbjs/lib/.*

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*
.*/node_modules/fbjs/.*

[include]

[libs]
node_modules/react-native/interface.js
node_modules/react-native/flow/
flow-typed/

[options]
server.max_workers=4
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
Expand All @@ -49,9 +55,12 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty

; Errors from built-in Flow library definitions
exact_by_default=false


well_formed_exports=true
experimental.abstract_locations=true

sharedmemory.heap_size=4000000000

Expand All @@ -64,8 +73,6 @@ nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
- name: Install Dependencies
run: pnpm install
- name: Build android
run: cd example && pnpm build:android
run: cd example && NODE_OPTIONS="--openssl-legacy-provider" pnpm build:android
- name: Build Android Example App and Library
run: cd example/android && ./gradlew clean assembleDebug
ios:
Expand Down Expand Up @@ -145,6 +145,6 @@ jobs:
- name: Install Dependencies
run: pnpm install
- name: Build ios
run: cd example && pnpm build:ios
run: cd example && NODE_OPTIONS="--openssl-legacy-provider" pnpm build:ios
- name: Pod install
run: cd example && pod install --project-directory=ios
11 changes: 1 addition & 10 deletions example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@

const path = require('path');

const exclusionList = (() => {
try {
return require('metro-config/src/defaults/exclusionList');
} catch (_) {
// `blacklist` was renamed to `exclusionList` in 0.60
return require('metro-config/src/defaults/blacklist');
}
})();

const {makeMetroConfig} = require('@rnx-kit/metro-config');
const {makeMetroConfig, exclusionList} = require('@rnx-kit/metro-config');
const MetroSymlinksResolver = require('@rnx-kit/metro-resolver-symlinks');

const symlinkResolver = MetroSymlinksResolver();
Expand Down
7 changes: 2 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"hermes-engine": "0.10.0",
"react": "16.13.1",
"react": "17.0.2",
"react-native": "0.63.4",
"react-native-macos": "^0.63.0",
"react-native-windows": "^0.63.0"
Expand All @@ -28,14 +28,11 @@
"metro-react-native-babel-preset": "0.77.0",
"mkdirp": "^3.0.1",
"react-native-test-app": "1.4.6",
"react-test-renderer": "16.13.1",
"react-test-renderer": "17.0.2",
"@rnx-kit/metro-config": "1.3.7",
"@rnx-kit/metro-resolver-symlinks":"0.1.30"
},
"jest": {
"preset": "react-native"
},
"volta": {
"node": "16.20.1"
}
}
7 changes: 7 additions & 0 deletions flow-typed/globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @flow
// Global type definitions to suppress Flow library errors

// Declare global types that are causing issues in Flow's built-in libraries
declare class Headers {}
declare class Request {}
declare class Response {}
7 changes: 5 additions & 2 deletions js/SegmentedControl.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ type Props = $ReadOnly<{|
*/

class SegmentedControlIOS extends React.Component<Props> {
static defaultProps = {
static defaultProps: {|
values: $ReadOnlyArray<string | number>,
enabled: boolean,
|} = {
values: [],
enabled: true,
};
Expand All @@ -54,7 +57,7 @@ class SegmentedControlIOS extends React.Component<Props> {
this.props.onValueChange(event.nativeEvent.value);
};

render() {
render(): React.Node {
const {forwardedRef, fontStyle, activeFontStyle, values, ...props} =
this.props;
return (
Expand Down
8 changes: 5 additions & 3 deletions js/SegmentedControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
const colorScheme = appearance || colorSchemeHook;
const [segmentWidth, setSegmentWidth] = React.useState(0);
const animation = React.useRef(new Animated.Value(0)).current;
const ref = React.useRef();
const ref = React.useRef<?React.ElementRef<typeof View>>(null);

const handleChange = (index: number) => {
// mocks iOS's nativeEvent
Expand Down Expand Up @@ -75,15 +75,17 @@
Animated.timing(animation, {
toValue: isRTL * (selectedIndex || 0),
duration: 300,
easing: Easing.out(Easing.quad),
easing: Easing.out(Easing.quad.bind(Easing)),
useNativeDriver: true,
}).start();
}
}, [animation, segmentWidth, selectedIndex]);

React.useEffect(() => {
if (ref.current) {
ref.current.measure((_x, _y, width) => updateSegmentWidth(width));
ref.current.measure((_x: number, _y: number, width: number) =>
updateSegmentWidth(width),
);
}
}, [values, updateSegmentWidth]);

Expand Down Expand Up @@ -112,7 +114,7 @@
<Animated.View
style={[
styles.slider,
{

Check warning on line 117 in js/SegmentedControl.js

View workflow job for this annotation

GitHub Actions / lint (20)

Inline style: { zIndex: -1 }
transform: [{translateX: animation}],
width: segmentWidth - 4,
zIndex: -1,
Expand Down
4 changes: 2 additions & 2 deletions js/SegmentedControlTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ type Props = $ReadOnly<{|
testID?: string,
|}>;

function isBase64(str) {
function isBase64(str: mixed): boolean {
const regex =
/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/;
return str && regex.test(str);
return typeof str === 'string' && regex.test(str);
}

export const SegmentedControlTab = ({
Expand Down
2 changes: 1 addition & 1 deletion js/SegmentsSeparators.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SegmentsSeparators = ({
selectedIndex,
}: Props): React.Node => {
const colorScheme = useColorScheme();
const hide = (val) => {
const hide = (val: number) => {
return selectedIndex === val || selectedIndex === val + 1;
};

Expand Down
4 changes: 4 additions & 0 deletions js/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,8 @@ export type SegmentedControlProps = $ReadOnly<{|
* Style properties for the slider component (Animated.View)
*/
sliderStyle?: ViewStyle,
/**
* Accessibility hint separator text
*/
accessibilityHintSeperator?: string,
|}>;
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@
"babel-jest": "^29.0.3",
"babel-preset-expo": "^9.2.0",
"eslint": "8",
"eslint-plugin-ft-flow": "^3.0.11",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.0",
"expo": "^46.0.16",
"flow-bin": "^0.142.0",
"flow-bin": "^0.237.2",
"husky": "^8.0.1",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.77.0",
"prettier": "^3.0.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.63.4",
Expand All @@ -52,7 +53,7 @@
"react-test-renderer": "17.0.2",
"rimraf": "^3.0.2",
"semantic-release": "^23.0.6",
"typescript": "^4"
"typescript": "^5.9.2"
},
"resolutions": {
"@react-native-community/cli": "4.10.0"
Expand Down
Loading
Loading