From b439c5d138b693fd5466387679a5817b560673f8 Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Tue, 16 Apr 2024 17:11:27 +0200 Subject: [PATCH 01/11] remove redundant workflow files --- .github/dependabot.yml | 30 ---------------------- .github/workflows/cla.yml | 22 ---------------- .github/workflows/conventional-commits.yml | 18 ------------- .github/workflows/gh-pages.yml | 29 --------------------- 4 files changed, 99 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/cla.yml delete mode 100644 .github/workflows/conventional-commits.yml delete mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index a441a60..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -registries: - rubygems-server-pkgs-shopify-io: - type: rubygems-server - url: https://pkgs.shopify.io - username: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_USERNAME}} - password: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_PASSWORD}} - github-com: - type: git - url: https://github.com - username: ${{secrets.DEPENDENCIES_GITHUB_USER}} - password: ${{secrets.DEPENDENCIES_GITHUB_TOKEN}} - npm-registry-npm-shopify-io-node: - type: npm-registry - url: https://npm.shopify.io/node - token: ${{secrets.NPM_REGISTRY_NPM_SHOPIFY_IO_NODE_TOKEN}} -updates: - - package-ecosystem: bundler - directory: '/' - schedule: - interval: weekly - open-pull-requests-limit: 100 - insecure-external-code-execution: allow - registries: '*' - - package-ecosystem: npm - directory: '/' - schedule: - interval: weekly - open-pull-requests-limit: 100 - registries: '*' diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 index ecd71ce..0000000 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Contributor License Agreement (CLA) - -on: - pull_request_target: - types: [opened, synchronize] - issue_comment: - types: [created] - -jobs: - cla: - runs-on: ubuntu-latest - if: | - (github.event.issue.pull_request - && !github.event.issue.pull_request.merged_at - && contains(github.event.comment.body, 'signed') - ) - || (github.event.pull_request && !github.event.pull_request.merged) - steps: - - uses: Shopify/shopify-cla-action@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - cla-token: ${{ secrets.CLA_TOKEN }} diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml deleted file mode 100644 index c830eca..0000000 --- a/.github/workflows/conventional-commits.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Conventional Commits Checker -on: - pull_request: - types: [opened, synchronize, reopened, edited] -jobs: - lint-commits: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.1 - with: - fetch-depth: 0 - - name: Setup NodeJS and NPM - uses: actions/setup-node@v2 - with: - node-version: 16.13.2 - - name: Add @commitlint - run: npm install -g @commitlint/cli @commitlint/config-conventional - - run: bin/conventional-commits.sh "${{ github.event.pull_request.title }}" ${{ github.event.pull_request.commits }} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml deleted file mode 100644 index 23de631..0000000 --- a/.github/workflows/gh-pages.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Deploy documentation -'on': - push: - branches: - - main -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Install Yarn - run: npm install --global yarn - - name: Checkout - uses: actions/checkout@v3 - - name: Install & Build Docs - run: | - cd docs - yarn - yarn build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build - user_name: github-actions[bot] - user_email: github-actions[bot]@users.noreply.github.com From b480ca21947df535643e0f9abf769a996e0044b3 Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Tue, 16 Apr 2024 17:16:04 +0200 Subject: [PATCH 02/11] add npm pack job --- .github/workflows/react-native-performance.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/react-native-performance.yml b/.github/workflows/react-native-performance.yml index ffac0ba..7e0b2b7 100644 --- a/.github/workflows/react-native-performance.yml +++ b/.github/workflows/react-native-performance.yml @@ -141,3 +141,20 @@ jobs: yarn cd android ./gradlew assembleDebug + npm-pack-dry-run: + name: 'NPM Pack with dry-run' + runs-on: ubuntu-latest + steps: + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Install Yarn + run: npm install --global yarn + - name: Checkout + uses: actions/checkout@v3 + - name: Build Typescript + run: | + yarn + yarn build + npm pack --dry-run From 35c36e0b808b302c9df2c9d316c406306d7a40d1 Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Tue, 16 Apr 2024 17:40:36 +0200 Subject: [PATCH 03/11] exclude /src, map files, __tests__ from package --- packages/react-native-performance/package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index 28d4aa9..8884f12 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -40,10 +40,12 @@ "react-test-renderer": "17.0.2" }, "files": [ - "android", + "android/src", + "android/build.gradle", "dist", + "!dist/__tests__/*", + "!**/*.map", "ios", - "src", "*.podspec" ] } From b0524c0ef3a321923a7e3b9ca44125d7f3ba7ff7 Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Tue, 16 Apr 2024 17:57:21 +0200 Subject: [PATCH 04/11] update URLs from Shopify to Exodus --- .../ReactNativePerformance.podspec | 2 +- packages/react-native-performance/package.json | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/react-native-performance/ReactNativePerformance.podspec b/packages/react-native-performance/ReactNativePerformance.podspec index 7238dd0..7da1ade 100644 --- a/packages/react-native-performance/ReactNativePerformance.podspec +++ b/packages/react-native-performance/ReactNativePerformance.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.license = package['license'] s.author = package['author'] s.platform = :ios, '11.0' - s.source = { :git => 'https://github.com/shopify/react-native-performance.git', :tag => "v#{s.version}" } + s.source = { :git => 'https://github.com/ExodusMovement/react-native-performance.git', :tag => "v#{s.version}" } s.source_files = 'ios/**/*.{h,m,swift}' s.exclude_files = 'ios/**/*Tests.{h,m,swift}' s.requires_arc = true diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index 8884f12..b678f3e 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -1,17 +1,13 @@ { - "name": "@shopify/react-native-performance", + "name": "@exodus/react-native-performance", "version": "4.1.2", "description": "A library for measuring the render times for the different flows in your app.", - "publishConfig": { - "access": "public", - "@shopify:registry": "https://registry.npmjs.org/" - }, "main": "dist/index.js", "types": "dist/index.d.ts", "keywords": [ "react-native" ], - "author": "shopify", + "author": "ExodusMovement", "license": "MIT", "scripts": { "build": "tsc -b", @@ -20,12 +16,12 @@ "test": "tsc -b && yarn jest" }, "bugs": { - "url": "https://github.com/shopify/react-native-performance/issues" + "url": "https://github.com/ExodusMovement/react-native-performance/issues" }, - "homepage": "https://github.com/shopify/react-native-performance#readme", + "homepage": "https://github.com/ExodusMovement/react-native-performance#readme", "repository": { "type": "git", - "url": "git+https://github.com/shopify/react-native-performance.git" + "url": "git+https://github.com/ExodusMovement/react-native-performance.git" }, "peerDependencies": { "@babel/runtime": "*", From 3c0f3fbcc0f90a131507b8dad739251d89d30f7a Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Mon, 22 Apr 2024 12:06:31 +0200 Subject: [PATCH 05/11] reverted the https://github.com/Shopify/react-native-performance/commit/e80e6d4e7ee5627422a9e2211b047c1d00ce1154 to fix compilation error --- .../ios/ReactNativePerformance/ReactNativePerformance.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-performance/ios/ReactNativePerformance/ReactNativePerformance.m b/packages/react-native-performance/ios/ReactNativePerformance/ReactNativePerformance.m index dbb4bb5..7e413c1 100644 --- a/packages/react-native-performance/ios/ReactNativePerformance/ReactNativePerformance.m +++ b/packages/react-native-performance/ios/ReactNativePerformance/ReactNativePerformance.m @@ -1,5 +1,5 @@ #import "ReactNativePerformance.h" -#import +#import static NSTimeInterval startupTimestamp = -1.0; From 5afe2238511dc4e988057920bf84df4b8ac8df29 Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Wed, 24 Apr 2024 16:51:34 +0200 Subject: [PATCH 06/11] removed .d.ts files from NPM package --- packages/react-native-performance/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index b678f3e..a40be39 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -1,6 +1,6 @@ { "name": "@exodus/react-native-performance", - "version": "4.1.2", + "version": "4.1.2-rc.1", "description": "A library for measuring the render times for the different flows in your app.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -42,6 +42,9 @@ "!dist/__tests__/*", "!**/*.map", "ios", - "*.podspec" + "*.podspec", + "!**/*.d.ts", + "!dist/tsconfig.tsbuildinfo", + "!ios/ReactNativePerformance/ReactNativePerformanceTests.swift" ] } From 32adbe60df555ef76f2e0416d1e2a63abccbf040 Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Wed, 24 Apr 2024 16:57:34 +0200 Subject: [PATCH 07/11] changed target version to 'ES6' --- packages/react-native-performance/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native-performance/tsconfig.json b/packages/react-native-performance/tsconfig.json index fbd1bda..00ef077 100644 --- a/packages/react-native-performance/tsconfig.json +++ b/packages/react-native-performance/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "./dist", - "rootDir": "./src" + "rootDir": "./src", + "target":"ES6" }, "include": ["src/**/*"], "exclude": ["node_modules", "**/*.test.ts?(x)"] From bff9c418649913653b5df66d282dd1614778a6cb Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Tue, 30 Apr 2024 12:15:00 +0200 Subject: [PATCH 08/11] implement security hardenings --- packages/react-native-performance/package.json | 2 +- .../src/BridgedEventTimestamp.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index a40be39..ff6853c 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -1,6 +1,6 @@ { "name": "@exodus/react-native-performance", - "version": "4.1.2-rc.1", + "version": "4.1.2-rc.2", "description": "A library for measuring the render times for the different flows in your app.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/react-native-performance/src/BridgedEventTimestamp.ts b/packages/react-native-performance/src/BridgedEventTimestamp.ts index 714a91d..05abae5 100644 --- a/packages/react-native-performance/src/BridgedEventTimestamp.ts +++ b/packages/react-native-performance/src/BridgedEventTimestamp.ts @@ -1,4 +1,4 @@ -import {getNativeTime} from './utils'; +import { getNativeTime } from './utils'; export class BridgedEventTimestampBuilder { private _nativeTimestamp: Promise | undefined; @@ -34,7 +34,7 @@ export class BridgedEventTimestampBuilder { return new BridgedEventTimestamp(Date.now(), this._nativeTimestamp); } - const {jsNowWithEpochReference, nativeTimestampWithEpochReference} = translateNativeTimestampToEpochReference( + const { jsNowWithEpochReference, nativeTimestampWithEpochReference } = translateNativeTimestampToEpochReference( this._nativeTimestamp, ); return new BridgedEventTimestamp(jsNowWithEpochReference, nativeTimestampWithEpochReference); @@ -60,6 +60,9 @@ export default class BridgedEventTimestamp { readonly jsTimestamp: number; constructor(jsTimestamp: number, nativeTimestamp: Promise | undefined) { + if (jsTimestamp && typeof jsTimestamp !== 'number') { + throw new Error('Invalid jsTimestamp type'); + } this.jsTimestamp = jsTimestamp; this.nativeTimestamp = nativeTimestamp; } @@ -86,7 +89,7 @@ function translateNativeTimestampToEpochReference(nativeTimestampWithSystemBootR const nativeTimestampWithEpochReference = Promise.all([getNativeTime(), nativeTimestampWithSystemBootReference]).then( ([ - {nativeTimeSinceEpochMillis: nativeNowWithEpochReference, nativeUptimeMillis: nativeNowWithSystemBootReference}, + { nativeTimeSinceEpochMillis: nativeNowWithEpochReference, nativeUptimeMillis: nativeNowWithSystemBootReference }, nativeTimestampWithSystemBootReference, ]) => { // If the JS <-> native communication were instantaneous, the nativeTimeSinceEpochMillis === jsNowWithEpochReference. From d65729209edc47f9905d53282aa9e62b86f9381b Mon Sep 17 00:00:00 2001 From: Mykhailo Baraniak Date: Thu, 2 May 2024 10:43:18 +0200 Subject: [PATCH 09/11] bumped version from the release candidate --- packages/react-native-performance/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index ff6853c..9fcc57c 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -1,6 +1,6 @@ { "name": "@exodus/react-native-performance", - "version": "4.1.2-rc.2", + "version": "4.1.2", "description": "A library for measuring the render times for the different flows in your app.", "main": "dist/index.js", "types": "dist/index.d.ts", From 693f610c9ee5ea8561a810bec9865c2bb54032e8 Mon Sep 17 00:00:00 2001 From: raxodus <251626932+raxodus@users.noreply.github.com> Date: Mon, 27 Apr 2026 16:28:41 +0200 Subject: [PATCH 10/11] fix(android): match RN 0.85 ViewManager.getExportedCustomDirectEventTypeConstants signature RN 0.85 changed ViewManager.getExportedCustomDirectEventTypeConstants() to return Map? instead of MutableMap. Update the PerformanceMarker view manager override to align with the new contract. Bumps version to 4.1.2-exodus.0. --- .../com/shopify/reactnativeperformance/PerformanceMarker.kt | 2 +- packages/react-native-performance/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-performance/android/src/main/kotlin/com/shopify/reactnativeperformance/PerformanceMarker.kt b/packages/react-native-performance/android/src/main/kotlin/com/shopify/reactnativeperformance/PerformanceMarker.kt index 19b8fb4..9096d34 100644 --- a/packages/react-native-performance/android/src/main/kotlin/com/shopify/reactnativeperformance/PerformanceMarker.kt +++ b/packages/react-native-performance/android/src/main/kotlin/com/shopify/reactnativeperformance/PerformanceMarker.kt @@ -121,7 +121,7 @@ class PerformanceMarkerManager : SimpleViewManager() { view.componentInstanceId = componentInstanceId } - override fun getExportedCustomDirectEventTypeConstants(): MutableMap { + override fun getExportedCustomDirectEventTypeConstants(): Map { return MapBuilder.builder().put( "onRenderComplete", MapBuilder.of( diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index 9fcc57c..556c65a 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -1,6 +1,6 @@ { "name": "@exodus/react-native-performance", - "version": "4.1.2", + "version": "4.1.2-exodus.0", "description": "A library for measuring the render times for the different flows in your app.", "main": "dist/index.js", "types": "dist/index.d.ts", From 228b9c07ae668f0787937e22923dfce4636a2e33 Mon Sep 17 00:00:00 2001 From: raxodus <251626932+raxodus@users.noreply.github.com> Date: Mon, 27 Apr 2026 17:15:48 +0200 Subject: [PATCH 11/11] chore: update yarn.lock --- yarn.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yarn.lock b/yarn.lock index 904c98f..1a9319e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3401,6 +3401,11 @@ dependencies: recharts "^2.1.8" +"@shopify/react-native-performance@4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@shopify/react-native-performance/-/react-native-performance-4.1.2.tgz#bd111af291b85ee125feaccd54c8e5f237a76ce7" + integrity sha512-1Xu2xo+hAxg75iuX5akVqAgc3h/J1ohfi7JKXlGsprP4ylpW7kHMfq/7AstL7FoUC8xcHsTUvUFhoZ94ot8g6Q== + "@sideway/address@^4.1.3": version "4.1.4" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0"