Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into rootviewstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
acoates-ms committed Jun 3, 2024
2 parents 31a6102 + 84ff977 commit be4bb70
Show file tree
Hide file tree
Showing 170 changed files with 2,270 additions and 2,079 deletions.
2 changes: 1 addition & 1 deletion .circleci/configurations/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ commands:
steps:
- run:
name: "Run Tests: iOS Unit and Integration Tests"
command: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios
command: yarn test-ios
- run:
name: Zip Derived data folder
when: always
Expand Down
5 changes: 2 additions & 3 deletions .circleci/configurations/test_workflows/testAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,26 @@
- test_ios_template:
requires:
- build_npm_package
architecture: "NewArch"
matrix:
parameters:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
architecture: ["NewArch", "OldArch"]
exclude:
# This config is tested with Ruby 3.2.0. Let's not double test it.
- flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
architecture: "NewArch"
- test_ios_rntester:
requires:
- build_hermes_macos
use_frameworks: "DynamicFrameworks"
architecture: "NewArch"
ruby_version: "3.2.0"
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
architecture: ["NewArch", "OldArch"]
- test_ios_rntester:
run_unit_tests: true
use_frameworks: "StaticLibraries"
Expand Down
5 changes: 2 additions & 3 deletions .circleci/configurations/test_workflows/testIOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,26 @@
- test_ios_template:
requires:
- build_npm_package
architecture: "NewArch"
matrix:
parameters:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
architecture: ["NewArch", "OldArch"]
exclude:
# This config is tested with Ruby 3.2.0. Let's not double test it.
- flavor: "Debug"
jsengine: "Hermes"
use_frameworks: "StaticLibraries"
architecture: "NewArch"
- test_ios_rntester:
requires:
- build_hermes_macos
use_frameworks: "DynamicFrameworks"
ruby_version: "3.2.0"
architecture: "NewArch"
matrix:
parameters:
jsengine: ["Hermes", "JSC"]
architecture: ["NewArch", "OldArch"]
- test_ios_rntester:
run_unit_tests: true
use_frameworks: "StaticLibraries"
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ untyped-import
untyped-type-import

[version]
^0.236.0
^0.237.1
2 changes: 1 addition & 1 deletion .github/actions/test_ios_rntester/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ runs:
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == true }}
shell: bash
run: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios
run: yarn test-ios
- name: Zip Derived data folder
if: ${{ inputs.run-unit-tests == true }}
shell: bash
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish_bumped_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Bumped Packages

on:
push:
branches:
- "main"
- "*-stable"

jobs:
publish_bumped_packages:
runs-on: ubuntu-latest
env:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run Yarn Install
run: yarn install
- name: Build packages
run: yarn build
- name: Set NPM auth token
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
- name: Find and publish all bumped packages
run: node ./scripts/releases-ci/publish-updated-packages.js
8 changes: 3 additions & 5 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*'
# nightly build @ 2:15 AM UTC
schedule:
- cron: '15 2 * * *'
branches:
- main
- "*-stable"

jobs:
set_release_type:
Expand Down
61 changes: 61 additions & 0 deletions flow-typed/npm/listr2_v8.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow
* @format
*/

declare module 'listr2' {
declare export type TaskResult<
ContextT = {__proto__: null},
ReturnT = mixed,
> =
| ReturnT
| Promise<ReturnT>
| rxjs$Observable<ReturnT>
| stream$Readable
| Listr<ContextT>;

declare type TaskFn<ContextT, ReturnT> = (
ctx: ContextT,
task: TaskInstance,
) => TaskResult<ContextT, ReturnT>;

declare type SkipResultSync = boolean | string;
declare type SkipResult = SkipResultSync | Promise<SkipResultSync>;
declare type SkipFn<ContextT> = (ctx: ContextT) => SkipResult;

declare type CustomRenderer = {...}; // TODO

declare interface TaskInstance {
title: string;
output: string;
skip(reason?: string): void;
}

declare export type TaskSpec<
ContextT = {__proto__: null},
ReturnT = mixed,
> = {
title: string,
task: TaskFn<ContextT, ReturnT>,
skip?: SkipFn<ContextT>,
};

declare export type Options = {
concurrent?: boolean | number,
exitOnError?: boolean,
renderer?: 'default' | 'verbose' | 'silent' | CustomRenderer,
nonTTYRenderer?: 'default' | 'verbose' | 'silent' | CustomRenderer,
};

declare export class Listr<ContextT> {
constructor<ReturnT>(
tasks: Array<TaskSpec<ContextT, ReturnT>>,
options?: Options,
): void;
add<ReturnT>(task: TaskSpec<ContextT, ReturnT>): this;
add<ReturnT>(tasks: $ReadOnlyArray<TaskSpec<ContextT, ReturnT>>): this;
run(ctx?: ContextT): Promise<ContextT>;
}
}
18 changes: 9 additions & 9 deletions flow-typed/npm/rxjs_v6.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ declare class rxjs$Observable<T> implements rxjs$Subscribable<T> {
op9: rxjs$OperatorFunction<H, I>,
...operations: rxjs$OperatorFunction<any, any>[]
): rxjs$Observable<{...}>;
toPromise<T>(): Promise<T>;
toPromise<T>(PromiseCtor: typeof Promise): Promise<T>;
toPromise<T>(PromiseCtor: typeof Promise.constructor): Promise<T>;
toPromise(): Promise<T>;
toPromise(PromiseCtor: typeof Promise): Promise<T>;
toPromise(PromiseCtor: typeof Promise.constructor): Promise<T>;
}

declare class rxjs$Subscription implements rxjs$SubscriptionLike {
Expand All @@ -238,11 +238,11 @@ declare class rxjs$Subscriber<T>
extends rxjs$Subscription
implements rxjs$Observer<T>
{
static create<T>(
next?: (x?: T) => void,
static create<U>(
next?: (x?: U) => void,
error?: (e?: any) => void,
complete?: () => void,
): rxjs$Subscriber<T>;
): rxjs$Subscriber<U>;
// @internal
syncErrorValue: any;
// @internal
Expand Down Expand Up @@ -327,8 +327,8 @@ declare class rxjs$Notification<T> {
complete?: () => void,
): any;
toObservable(): rxjs$Observable<T>;
static createNext<T>(value: T): rxjs$Notification<T>;
static createError<T>(err?: any): rxjs$Notification<T>;
static createNext<U>(value: U): rxjs$Notification<U>;
static createError<U>(err?: any): rxjs$Notification<U>;
static createComplete(): rxjs$Notification<any>;
}

Expand Down Expand Up @@ -1793,7 +1793,7 @@ declare module 'rxjs' {
delay?: number,
): any;
_execute(state: T, delay: number): any;
static sortActions<T>(a: VirtualAction<T>, b: VirtualAction<T>): 1 | -1 | 0;
static sortActions<U>(a: VirtualAction<U>, b: VirtualAction<U>): 1 | -1 | 0;
}

declare class Scheduler implements rxjs$SchedulerLike {
Expand Down
14 changes: 0 additions & 14 deletions flow-typed/npm/temp-dir_2.x.x.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.21.1",
"flow-bin": "^0.236.0",
"flow-bin": "^0.237.1",
"glob": "^7.1.1",
"hermes-eslint": "0.21.1",
"hermes-transform": "0.21.1",
Expand Down
30 changes: 23 additions & 7 deletions packages/core-cli-utils/src/private/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ type BundlerOptions = {
outputBundle: string,
cwd: string,

target: 'hermes' | 'jsc',
jsvm: 'hermes' | 'jsc',
hermes?: HermesConfig,

...Bundler,
};

type HermesConfig = {
// iOS: Pods/hermes-engine/destroot/bin/hermesc
// Path where hermes is is installed
// iOS: Pods/hermes-engine
path: string,
// iOS: <hermes.path>/destroot/bin/hermesc
hermesc: string,
};

Expand Down Expand Up @@ -124,7 +127,7 @@ const bundleApp = (
// to then be converted to bytecode in the outputBundle. Otherwise just write to
// the outputBundle directly.
let output =
options.target === 'hermes' ? options.outputJsBundle : options.outputBundle;
options.jsvm === 'hermes' ? options.outputJsBundle : options.outputBundle;

// TODO: Fix this by not using Metro CLI, which appends a .js extension
if (output === options.outputJsBundle && !output.endsWith('.js')) {
Expand All @@ -146,7 +149,7 @@ const bundleApp = (
'--out',
output,
];
if (options.target === 'hermes' && !options.dev) {
if (options.jsvm === 'hermes' && !options.dev) {
// Hermes doesn't require JS minification
args.push('--minify', 'false');
} else {
Expand All @@ -159,12 +162,25 @@ const bundleApp = (
}),
};

if (options.target === 'jsc') {
if (options.jsvm === 'jsc') {
return bundle;
}

// $FlowIgnore[incompatible-use] We know it's a Hermes config
const hermesc: string = options.hermes.hermesc;
if (options.hermes?.path == null || options.hermes?.hermesc == null) {
throw new Error('If jsvm == "hermes", hermes config must be provided.');
}

const hermes: HermesConfig = options.hermes;

const isHermesInstalled: boolean = fs.existsSync(hermes.path);
if (!isHermesInstalled) {
throw new Error(
'Hermes Pod must be installed before bundling.\n' +
'Did you forget to bootstrap?',
);
}

const hermesc: string = path.join(hermes.path, hermes.hermesc);

/*
* Hermes only tasks:
Expand Down
Loading

0 comments on commit be4bb70

Please sign in to comment.