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

Rn76 up #3767

Merged
merged 7 commits into from
Feb 16, 2025
Merged

Rn76 up #3767

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
2 changes: 1 addition & 1 deletion .github/workflows/ci-for-forked-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: "CI requiring tokens"
uses: ./.github/workflows/ci-requiring-tokens.yml
with:
NVMRC: v18.18.0
NVMRC: v20.14.0
env_name: CI with Mapbox Tokens
ref: ${{ github.event.pull_request.head.sha }}
secrets:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ios-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
type: string
ref:
required: false
type: string
type: string
NVMRC:
required: true
type: string
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
if: ${{ inputs.ref == '' }}

- name: Checkout fork
uses: actions/checkout@v4
if: ${{ inputs.ref != '' }}
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
SKIP_TESTS_NO_METAL: ${{ inputs.MAP_IMPL == 'mapbox' || inputs.MAP_IMPL == 'mapbox11' }}

- name: Store Detox artifacts on test failure
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: detox-artifacts
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v18.18.0
v20.14.0

4 changes: 3 additions & 1 deletion __tests__/__mocks__/react-native.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jest.mock('react-native/Libraries/Image/resolveAssetSource', () => {

jest.mock('../../src/assets/heading.png', () => 'heading.png');


jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter', () => {
function MockEventEmitter() {}
MockEventEmitter.prototype.addListener = jest.fn(() => ({
Expand All @@ -28,10 +29,11 @@ jest.mock('react-native/Libraries/Utilities/Platform', () => ({
},
}));

jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper', () => ({
jest.mock('react-native/src/private/animated/NativeAnimatedHelper', () => ({
addListener: jest.fn(),
API: {
flushQueue: jest.fn(),
},
shouldUseNativeDriver: jest.fn(),
}));

15 changes: 8 additions & 7 deletions __tests__/components/UserLocation.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react-native';
import { render, fireEvent, act } from '@testing-library/react-native';

import UserLocation from '../../src/components/UserLocation';
import { ShapeSource } from '../../src/components/ShapeSource';
Expand Down Expand Up @@ -39,6 +39,7 @@

test('renders with CircleLayers by default', async () => {
const { UNSAFE_getAllByType } = await render(<UserLocation />);
await act(async () => {})

const shapeSource = UNSAFE_getAllByType(ShapeSource);
const circleLayer = UNSAFE_getAllByType(CircleLayer);
Expand All @@ -51,6 +52,7 @@
const { UNSAFE_queryByType } = await render(
<UserLocation visible={false} />,
);
await act(async () => {})

const shapeSource = UNSAFE_queryByType(ShapeSource);
const circleLayer = UNSAFE_queryByType(CircleLayer);
Expand All @@ -61,7 +63,6 @@

test('renders with CustomChild when provided', async () => {
const circleLayerProps = {
key: 'testUserLocationCircle',
id: 'testUserLocationCircle',
style: {
circleRadius: 5,
Expand All @@ -71,11 +72,11 @@
},
};

const { UNSAFE_queryByType, UNSAFE_queryAllByType } = await render(
<UserLocation>
<CircleLayer {...circleLayerProps} />
</UserLocation>,
);
const { UNSAFE_queryByType, UNSAFE_queryAllByType } = await render(<UserLocation>
<CircleLayer key='testUserLocationCircle' {...circleLayerProps} />
</UserLocation>)
await act(async () => {
})

const shapeSource = UNSAFE_queryByType(ShapeSource);
const circleLayer = UNSAFE_queryAllByType(CircleLayer);
Expand Down Expand Up @@ -167,7 +168,7 @@
expect(ul.locationManagerRunning).toStrictEqual(false);
});

// TODO: replace object { running: boolean } argument with simple boolean

Check warning on line 171 in __tests__/components/UserLocation.test.js

View workflow job for this annotation

GitHub Actions / lint_test_generate

Unexpected 'todo' comment: 'TODO: replace object { running: boolean...'
describe('#setLocationManager', () => {
test('called with "running" true', async () => {
const lastKnownLocation = [4.1036916, 51.5462244];
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['@react-native/babel-preset'],
plugins: [['@babel/plugin-proposal-class-properties', { loose: true }]],
env: {
production: {
Expand Down
2 changes: 1 addition & 1 deletion example/.nvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v18.18.0
v20.14.0

2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ buildscript {
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
kotlinVersion = "1.9.25"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
28 changes: 14 additions & 14 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"dependencies": {
"@mapbox/geo-viewport": "^0.5.0",
"@mapbox/mapbox-sdk": "^0.13.0",
"@react-native-async-storage/async-storage": "^1.22.3",
"@react-native-async-storage/async-storage": "^2.1.1",
"@react-navigation/compat": "^5.3.20",
"@react-navigation/native": "^6.0.17",
"@react-navigation/native-stack": "^6.9.26",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@rneui/base": "^4.0.0-rc.6",
"@rnmapbox/maps": "link:../",
"@turf/along": "^6.5.0",
Expand All @@ -38,9 +38,9 @@
"moment": "^2.24.0",
"prop-types": "^15.7.2",
"react": "18.3.1",
"react-native": "0.76.0",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "3.35.0",
"react-native": "0.76.6",
"react-native-safe-area-context": "5.2.0",
"react-native-screens": "4.6.0",
"react-native-vector-icons": "9.2.0"
},
"optionalDependencies": {
Expand All @@ -55,14 +55,14 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.0-alpha.2",
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
"@react-native/babel-preset": "0.76.0",
"@react-native/eslint-config": "0.76.0",
"@react-native/metro-config": "0.76.0",
"@react-native/typescript-config": "0.76.0",
"@types/react": "^18.2.45",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.7",
"@react-native/eslint-config": "0.76.7",
"@react-native/metro-config": "0.76.7",
"@react-native/typescript-config": "0.76.7",
"@types/react": "^18.3.1",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"babel-plugin-module-resolver": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Config } from 'jest';

const config: Config = {
verbose: true,
preset: '@testing-library/react-native',
preset: 'react-native',
roots: ['__tests__/'],
setupFilesAfterEnv: [
'./setup-jest.js',
Expand Down
28 changes: 16 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,22 @@
"debounce": "^1.2.0"
},
"devDependencies": {
"@babel/core": "7.19.1",
"@babel/core": "7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/helper-split-export-declaration": "7.24.7",
"@babel/helper-hoist-variables": "7.24.7",
"@babel/helper-function-name": "7.24.7",
"@babel/runtime": "7.19.0",
"@react-native/eslint-config": "^0.72.2",
"@babel/runtime": "7.25.0",
"@react-native/eslint-config": "^0.76.7",
"@sinonjs/fake-timers": "^8.0.1",
"@testing-library/react-native": "^12.4.0",
"@testing-library/react-native": "^13.0.1",
"@types/debounce": "^1.2.1",
"@types/mapbox-gl": "^2.7.5",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"babel-jest": "^29.6.3",
"babel-jest": "^29.7.0",
"documentation": "14.0.0",
"ejs": "^3.1.3",
"ejs-lint": "^1.1.0",
Expand All @@ -106,24 +107,27 @@
"eslint-plugin-ft-flow": "^2.0.3",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-jest": "^27.0.1",
"expo": "^47.0.0",
"expo": "^51.0.18",
"expo-module-scripts": "^3.0.4",
"husky": "^8.0.1",
"jest": "29.7.0",
"jest-cli": "29.7.0",
"lint-staged": "^12.1.2",
"mapbox-gl": "^2.9.0",
"metro-react-native-babel-preset": "0.71.1",
"@react-native/babel-preset": "0.76.7",
"node-dir": "0.1.17",
"prettier": "2.7.1",
"react": "18.2.0",
"react": "18.3.1",
"react-docgen": "rnmapbox/react-docgen#rnmapbox-dist-react-docgen-v6",
"react-native": "0.73.0-rc.4",
"react-native-builder-bob": "^0.23.1",
"react-test-renderer": "18.2.0",
"to-fast-properties": "3.0.1",
"react-native": "0.76.7",
"react-native-builder-bob": "^0.36.0",
"react-test-renderer": "18.3.1",
"ts-node": "10.9.1",
"typescript": "5.1.3",
"@mdx-js/mdx": "^3.0.0"
"@mdx-js/mdx": "^3.0.0",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.0.0"
},
"codegenConfig": {
"name": "rnmapbox_maps_specs",
Expand Down
2 changes: 1 addition & 1 deletion src/components/SymbolLayer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { JSX } from 'react';
import { View, NativeModules } from 'react-native';

import {
Expand Down
6 changes: 4 additions & 2 deletions src/web/components/MapView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { type JSX } from 'react';
import mapboxgl from 'mapbox-gl';

import MapContext from '../MapContext';
Expand Down Expand Up @@ -34,7 +34,9 @@ class MapView extends React.Component<
return (
<div
style={{ width: '100%', height: '100%' }}
ref={(el) => (this.mapContainer = el)}
ref={(el) => {
this.mapContainer = el;
}}
>
{map && (
<div style={{ position: 'absolute' }}>
Expand Down
Loading
Loading