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

fix: add new macos examples #2372

Merged
merged 31 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
14ffb3f
build: add architecture to cache key
jakex7 Jul 25, 2024
e223041
Merge branch 'main' of github.com:software-mansion/react-native-svg i…
bohdanprog Jul 25, 2024
f19e5d3
feat: update Podfile
bohdanprog Jul 25, 2024
8098766
feat: update podfile.lock
bohdanprog Jul 25, 2024
c9c80e0
feat: update podfile.lock
bohdanprog Jul 25, 2024
98cbf5e
feat: add extra step
bohdanprog Jul 25, 2024
645fec3
feat: remove exatra step, remove Podfile.lock
bohdanprog Jul 25, 2024
037feef
feat: update workflows
bohdanprog Jul 26, 2024
f6633fa
feat: add log
bohdanprog Jul 26, 2024
6981356
Merge branch 'main' of github.com:software-mansion/react-native-svg i…
bohdanprog Jul 26, 2024
c7307ed
feat: update workflow
bohdanprog Jul 26, 2024
e7210d2
feat: update workflow
bohdanprog Jul 26, 2024
d194431
feat: update workflow
bohdanprog Jul 26, 2024
e1fc19b
feat: update workflow
bohdanprog Jul 26, 2024
dda1452
update workflows
bohdanprog Jul 26, 2024
ee4bbce
feat: resolve conflicts
bohdanprog Jul 26, 2024
a91251b
feat: update macos example
bohdanprog Jul 26, 2024
117cb7d
feat: add fabric-macos-example
bohdanprog Jul 26, 2024
0047d34
feat: add fabric-macos-example
bohdanprog Jul 26, 2024
34ad42c
feat: update macos-fabric-example
bohdanprog Jul 26, 2024
9163330
feat: update yarn.lock
bohdanprog Jul 26, 2024
ac1cc5d
feat: update workflows, macos examples
bohdanprog Jul 26, 2024
119e1d9
feat: update package.json
bohdanprog Jul 26, 2024
2e3793d
feat: update workflows
bohdanprog Jul 26, 2024
9b32bc5
feat: update macos examples
bohdanprog Jul 28, 2024
bb29ea2
feat: update package.json macos-paper
bohdanprog Jul 28, 2024
39f1020
feat: remove old project with macos example
bohdanprog Jul 29, 2024
a6abc28
feat: rename workflows for macos, clean metro.config
bohdanprog Jul 29, 2024
63d1fae
feat: restored changes in ReactNativeSVG.web.ts
bohdanprog Jul 29, 2024
1c2f634
feat: restored changes in extractTransform.ts
bohdanprog Jul 29, 2024
986b789
Merge branch 'main' of github.com:software-mansion/react-native-svg i…
bohdanprog Jul 29, 2024
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
21 changes: 0 additions & 21 deletions .github/workflows/macos-build-fabric-test.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/macos-build-test-fabric.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test fabric macOS build
on:
pull_request:
paths:
- .github/workflows/macos-build-test.yml
- RNSVG.podspec
- apple/**
- macos-example/package.json
- macos-example/macos/**
- src/fabric/**
- package.json
push:
branches:
- main

jobs:
build:
if: github.repository == 'software-mansion/react-native-svg'
runs-on: macos-14
strategy:
matrix:
working-directory: [fabric-macos-example]
fail-fast: false
concurrency:
group: macos-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Restore react-native-svg node_modules from cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-svg-

- name: Install react-native-svg node_modules
run: yarn install

- name: Restore app node_modules from cache
uses: actions/cache@v3
with:
path: ${{ matrix.working-directory }}/node_modules
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-

- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
run: yarn install

- name: Restore Pods from cache
uses: actions/cache@v3
with:
path: |
${{ matrix.working-directory }}/macos/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}

- name: Install Pods
working-directory: ${{ matrix.working-directory }}/macos
run: RCT_NEW_ARCH_ENABLED=1 pod install

- name: Restore build artifacts from cache
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}

- name: Build app
working-directory: ${{ matrix.working-directory }}
run: yarn macos
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
name: Reusable macOS Build

name: Test paper macOS build
on:
workflow_call:
inputs:
new_arch_enabled:
required: true
type: string
pull_request:
paths:
- .github/workflows/macos-build-test.yml
- RNSVG.podspec
- apple/**
- macos-example/package.json
- macos-example/macos/**
- src/fabric/**
- package.json
push:
branches:
- main

jobs:
build:
if: github.repository == 'software-mansion/react-native-svg'
runs-on: macos-14
strategy:
matrix:
working-directory: [macos-example]
working-directory: [paper-macos-example]
fail-fast: false
concurrency:
group: macos-${{ matrix.working-directory }}-${{ github.ref }}-${{ inputs.new_arch_enabled }}
group: macos-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
Expand All @@ -28,7 +35,7 @@ jobs:
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-svg-

- name: Install react-native-svg node modules
- name: Install react-native-svg node_modules
run: yarn install

- name: Restore app node_modules from cache
Expand All @@ -38,7 +45,7 @@ jobs:
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-

- name: Install app node modules
- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
run: yarn install

Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/macos-build-test.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# OSX
#
.DS_Store

.yarn
.yarnrc.yml
# Xcode
#
*.pbxuser
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# OSX
#
.DS_Store
.yarn

# Xcode
#
Expand Down
7 changes: 7 additions & 0 deletions fabric-macos-example/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react';
import App from '../App';

// Note: import explicitly to use the types shipped with jest.
import { it } from '@jest/globals';
import {it} from '@jest/globals';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
Expand Down
4 changes: 4 additions & 0 deletions fabric-macos-example/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "FabricMacOSExample",
"displayName": "FabricMacOSExample"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module.exports = {
},
},
],
['react-native-reanimated/plugin', { processNestedWorklets: true }],
['react-native-reanimated/plugin', {processNestedWorklets: true}],
],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions fabric-macos-example/macos/FabricMacOSExample-macOS/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
self.moduleName = @"FabricMacOSExample";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};

return [super applicationDidFinishLaunching:notification];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
#ifdef RN_FABRIC_ENABLED
return true;
#else
return false;
#endif
}

@end
Loading
Loading