Skip to content

Commit f9da9a9

Browse files
Merge branch 'master' into moo/MOO-1847-upgrade-react-native-fast-image
2 parents 956ef61 + b175ef8 commit f9da9a9

26 files changed

Lines changed: 903 additions & 392 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"colors": "1.4.0",
99
"react": "^18.2.0",
1010
"react-dom": "^18.2.0",
11-
"react-native": "^0.72.7"
11+
"react-native": "~0.77.3"
1212
},
1313
"license": "Apache-2.0",
1414
"copyright": "© Mendix Technology BV 2022. All rights reserved.",

packages/generator-widget/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- We upgraded React Native to version 0.77.3 for generated widgets.
12+
13+
- We updated the required Node.js version to 20 or newer for the generator and generated widget projects.
14+
15+
- We switched from Enzyme to React Native Testing Library for generated widget tests.
16+
917
## [10.15.1] - 2025-05-19
1018

1119
### Changed

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_native.json-js-unit.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"copyright": "Mendix 2023",
77
"author": "Jest",
88
"engines": {
9-
"node": ">=16"
9+
"node": ">=20"
1010
},
1111
"license": "Apache-2.0",
1212
"config": {
@@ -34,10 +34,10 @@
3434
},
3535
"resolutions": {
3636
"react": "^18.2.0",
37-
"react-native": "0.72.7"
37+
"react-native": "0.77.3"
3838
},
3939
"overrides": {
4040
"react": "^18.2.0",
41-
"react-native": "0.72.7"
41+
"react-native": "0.77.3"
4242
}
4343
}

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_native.json-js.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"copyright": "Mendix 2023",
77
"author": "Jest",
88
"engines": {
9-
"node": ">=16"
9+
"node": ">=20"
1010
},
1111
"license": "Apache-2.0",
1212
"config": {
@@ -29,10 +29,10 @@
2929
},
3030
"resolutions": {
3131
"react": "^18.2.0",
32-
"react-native": "0.72.7"
32+
"react-native": "0.77.3"
3333
},
3434
"overrides": {
3535
"react": "^18.2.0",
36-
"react-native": "0.72.7"
36+
"react-native": "0.77.3"
3737
}
3838
}

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_native.json-ts-unit.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"copyright": "Mendix 2023",
77
"author": "Jest",
88
"engines": {
9-
"node": ">=16"
9+
"node": ">=20"
1010
},
1111
"license": "Apache-2.0",
1212
"config": {
@@ -29,7 +29,6 @@
2929
"devDependencies": {
3030
"@mendix/pluggable-widgets-tools": "^10.15.0",
3131
"@types/big.js": "^6.0.2",
32-
"@types/enzyme": "^3.10.8",
3332
"@types/jest": "^29.0.0"
3433
},
3534
"dependencies": {
@@ -38,11 +37,11 @@
3837
"resolutions": {
3938
"react": "^18.2.0",
4039
"@types/react": "^18.2.0",
41-
"react-native": "0.72.7"
40+
"react-native": "0.77.3"
4241
},
4342
"overrides": {
4443
"react": "^18.2.0",
4544
"@types/react": "^18.2.0",
46-
"react-native": "0.72.7"
45+
"react-native": "0.77.3"
4746
}
4847
}

packages/generator-widget/generators/app/templates/packages/__tests__/outputs/package_native.json-ts.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"copyright": "Mendix 2023",
77
"author": "Jest",
88
"engines": {
9-
"node": ">=16"
9+
"node": ">=20"
1010
},
1111
"license": "Apache-2.0",
1212
"config": {
@@ -31,11 +31,11 @@
3131
"resolutions": {
3232
"react": "^18.2.0",
3333
"@types/react": "^18.2.0",
34-
"react-native": "0.72.7"
34+
"react-native": "0.77.3"
3535
},
3636
"overrides": {
3737
"react": "^18.2.0",
3838
"@types/react": "^18.2.0",
39-
"react-native": "0.72.7"
39+
"react-native": "0.77.3"
4040
}
4141
}

packages/generator-widget/generators/app/templates/packages/package_native.json.ejs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"copyright": <%- JSON.stringify(copyright) %>,
77
"author": <%- JSON.stringify(author) %>,
88
"engines": {
9-
"node": ">=16"
9+
"node": ">=20"
1010
},
1111
"license": <%- JSON.stringify(license) %>,
1212
"config": {
@@ -29,7 +29,6 @@
2929
"devDependencies": {
3030
"@mendix/pluggable-widgets-tools": "^10.15.0"<% if (isLanguageTS) { %>,
3131
"@types/big.js": "^6.0.2"<% if (hasUnitTests) { %>,
32-
"@types/enzyme": "^3.10.8",
3332
"@types/jest": "^29.0.0"<% } %><% } %>
3433
},
3534
"dependencies": {
@@ -38,11 +37,11 @@
3837
"resolutions": {
3938
"react": "^18.2.0",<% if (isLanguageTS) { %>
4039
"@types/react": "^18.2.0",<% } %>
41-
"react-native": "0.72.7"
40+
"react-native": "0.77.3"
4241
},
4342
"overrides": {
4443
"react": "^18.2.0",<% if (isLanguageTS) { %>
4544
"@types/react": "^18.2.0",<% } %>
46-
"react-native": "0.72.7"
45+
"react-native": "0.77.3"
4746
}
4847
}

packages/generator-widget/generators/app/templates/pluggable/native/emptyTemplateJs/src/components/__tests__/HelloWorld.spec.jsx.ejs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement } from "react";
2-
import { shallow } from "enzyme";
2+
import { render } from "@testing-library/react-native";
33
import { Platform } from "react-native";
44

55
import { HelloWorld } from "../HelloWorld";
@@ -15,18 +15,18 @@ describe.each(["ios", "android"])("HelloWorld for %s", (os) => {
1515
name: "Mendix",
1616
style: []
1717
};
18-
const helloWorld = shallow(<HelloWorld {...helloWorldProps} />);
18+
const component = render(<HelloWorld {...helloWorldProps} />);
1919

20-
expect(helloWorld).toMatchSnapshot();
20+
expect(component.toJSON()).toMatchSnapshot();
2121
});
2222

2323
it("renders the structure correctly with custom style", () => {
2424
const helloWorldProps = {
2525
name: "Mendix",
2626
style: [{ container: { borderColor: "white" }, label: { color: "black" } }]
2727
};
28-
const helloWorld = shallow(<HelloWorld {...helloWorldProps} />);
28+
const component = render(<HelloWorld {...helloWorldProps} />);
2929

30-
expect(helloWorld).toMatchSnapshot();
30+
expect(component.toJSON()).toMatchSnapshot();
3131
});
3232
});

packages/generator-widget/generators/app/templates/pluggable/native/emptyTemplateJsFn/src/components/__tests__/HelloWorld.spec.jsx.ejs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement } from "react";
2-
import { shallow } from "enzyme";
2+
import { render } from "@testing-library/react-native";
33
import { Platform } from "react-native";
44

55
import { HelloWorld } from "../HelloWorld";
@@ -15,18 +15,18 @@ describe.each(["ios", "android"])("HelloWorld for %s", (os) => {
1515
name: "Mendix",
1616
style: []
1717
};
18-
const helloWorld = shallow(<HelloWorld {...helloWorldProps} />);
18+
const component = render(<HelloWorld {...helloWorldProps} />);
1919

20-
expect(helloWorld).toMatchSnapshot();
20+
expect(component.toJSON()).toMatchSnapshot();
2121
});
2222

2323
it("renders the structure correctly with custom style", () => {
2424
const helloWorldProps = {
2525
name: "Mendix",
2626
style: [{ container: { borderColor: "white" }, label: { color: "black" } }]
2727
};
28-
const helloWorld = shallow(<HelloWorld {...helloWorldProps} />);
28+
const component = render(<HelloWorld {...helloWorldProps} />);
2929

30-
expect(helloWorld).toMatchSnapshot();
30+
expect(component.toJSON()).toMatchSnapshot();
3131
});
3232
});

packages/generator-widget/generators/app/templates/pluggable/native/emptyTemplateTs/src/components/__tests__/HelloWorld.spec.tsx.ejs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement } from "react";
2-
import { shallow } from "enzyme";
2+
import { render } from "@testing-library/react-native";
33
import { Platform } from "react-native";
44

55
import { HelloWorld, HelloWorldProps } from "../HelloWorld";
@@ -15,18 +15,18 @@ describe.each(["ios", "android"])("HelloWorld for %s", (os: "ios" | "android") =
1515
name: "Mendix",
1616
style: []
1717
};
18-
const helloWorld = shallow(<HelloWorld {...helloWorldProps} />);
18+
const component = render(<HelloWorld {...helloWorldProps} />);
1919

20-
expect(helloWorld).toMatchSnapshot();
20+
expect(component.toJSON()).toMatchSnapshot();
2121
});
2222

2323
it("renders the structure correctly with custom style", () => {
2424
const helloWorldProps: HelloWorldProps = {
2525
name: "Mendix",
2626
style: [{ container: { borderColor: "white" }, label: { color: "black" } }]
2727
};
28-
const helloWorld = shallow(<HelloWorld {...helloWorldProps} />);
28+
const component = render(<HelloWorld {...helloWorldProps} />);
2929

30-
expect(helloWorld).toMatchSnapshot();
30+
expect(component.toJSON()).toMatchSnapshot();
3131
});
3232
});

0 commit comments

Comments
 (0)