Skip to content
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
4 changes: 2 additions & 2 deletions packages/css-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@babel/preset-env": "^7.28.3",
"@babel/preset-typescript": "^7.27.1",
"@babel/runtime": "^7.28.4",
"@react-native-community/bob": "^0.17.1",
"@release-it/conventional-changelog": "^10.0.1",
"@types/jest": "^29.5.14",
"@types/react": "~19.1.0",
Expand All @@ -56,6 +55,7 @@
"metro-react-native-babel-preset": "^0.77.0",
"prettier": "^3.6.2",
"react": "19.1.0",
"react-native-builder-bob": "^0.40.13",
"release-config": "workspace:*",
"release-it": "^19.0.5",
"typescript": "^5.4.5"
Expand All @@ -66,7 +66,7 @@
"publishConfig": {
"access": "public"
},
"@react-native-community/bob": {
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
Expand Down
1 change: 0 additions & 1 deletion packages/render-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@react-native/babel-preset": "0.81.5",
"@release-it/conventional-changelog": "^10.0.1",
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/react-native": "^13.3.3",
"@types/jest": "^29.5.14",
"@types/react-test-renderer": "~19.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react-native';
import { useAmbientTRenderEngine } from '../../TRenderEngineProvider';

describe('useAmbientTRenderEngine', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { perf, wait } from 'react-performance-testing';
import { act, renderHook, render } from '@testing-library/react-native';
import { perf, wait } from 'react-performance-testing/native';
import useIMGElementState from '../useIMGElementState';
import { Image } from 'react-native';
import { waitFor } from '@testing-library/react-native';

/**
* Renders the hook inside a named component to allow extracting perf results
*/
function renderHookForPerf(renderFn: () => void) {
function TestComponent() {
renderFn();
return null;
}

return render(React.createElement(TestComponent));
}

describe('useIMGElementState', () => {
const props = {
contentWidth: 300,
Expand All @@ -14,7 +26,8 @@ describe('useIMGElementState', () => {
};
it('should render at most twice when width and height physical dimensions are not provided, prior and after fetching physical dimensions', async () => {
const { renderCount } = perf<{ TestComponent: unknown }>(React);
renderHook(() => useIMGElementState(props));

renderHookForPerf(() => useIMGElementState(props));
await wait(() => {
expect(renderCount.current.TestComponent.value).toBeLessThan(2);
});
Expand All @@ -23,15 +36,15 @@ describe('useIMGElementState', () => {
const { renderCount } = perf<{ TestComponent: unknown }>(React);
const source = { uri: 'http://via.placeholder.com/640x360', headers: {} };
const localProps = { ...props, source };
renderHook(() => useIMGElementState(localProps));
renderHookForPerf(() => useIMGElementState(localProps));
await wait(() => {
expect(renderCount.current.TestComponent.value).toBeLessThan(2);
});
expect(Image.getSizeWithHeaders).toHaveBeenCalled();
});
it('should render once when width and height physical dimensions are provided, bypassing the fetching of physical dimensions', async () => {
const { renderCount } = perf<{ TestComponent: unknown }>(React);
renderHook(() =>
renderHookForPerf(() =>
useIMGElementState({
...props,
width: 600,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react-native';
import useIMGElementStateWithCache from '../useIMGElementStateWithCache';

const props = {
Expand Down
4 changes: 2 additions & 2 deletions packages/transient-render-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@babel/preset-env": "^7.28.3",
"@babel/preset-typescript": "^7.27.1",
"@babel/runtime": "^7.28.4",
"@react-native-community/bob": "^0.17.1",
"@release-it/conventional-changelog": "^10.0.1",
"@tsconfig/react-native": "^3.0.7",
"@types/css-to-react-native": "^3.0.2",
Expand All @@ -62,6 +61,7 @@
"metro-react-native-babel-preset": "^0.77.0",
"prettier": "^3.6.2",
"react": "19.1.0",
"react-native-builder-bob": "^0.40.13",
"release-config": "workspace:*",
"release-it": "^19.0.5",
"typescript": "^5.4.5"
Expand All @@ -72,7 +72,7 @@
"publishConfig": {
"access": "public"
},
"@react-native-community/bob": {
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
Expand Down
Loading