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 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 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/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/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; diff --git a/packages/react-native-performance/package.json b/packages/react-native-performance/package.json index 28d4aa9..556c65a 100644 --- a/packages/react-native-performance/package.json +++ b/packages/react-native-performance/package.json @@ -1,17 +1,13 @@ { - "name": "@shopify/react-native-performance", - "version": "4.1.2", + "name": "@exodus/react-native-performance", + "version": "4.1.2-exodus.0", "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": "*", @@ -40,10 +36,15 @@ "react-test-renderer": "17.0.2" }, "files": [ - "android", + "android/src", + "android/build.gradle", "dist", + "!dist/__tests__/*", + "!**/*.map", "ios", - "src", - "*.podspec" + "*.podspec", + "!**/*.d.ts", + "!dist/tsconfig.tsbuildinfo", + "!ios/ReactNativePerformance/ReactNativePerformanceTests.swift" ] } 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. 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)"] 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"