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

Gradle - mergeDexRelease - @0.68.1-nightly - minimal repro #554

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ module.exports = {
'lib',
'babel.config.js',
'metro.config.js',
'.eslintrc.js',
'.eslintrc.js'
// '!/.github', // False positive: Error loading '@typescript-eslint/await-thenable' requires parserOptions.project
'!/.storybook',
'.storybook/storybook.requires.js' // Codegen
],
plugins: [
'deprecation',
Expand Down
7 changes: 4 additions & 3 deletions .storybook/Storybook.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import './storybook.requires'

import { getStorybookUI } from '@storybook/react-native'
// import { getStorybookUI } from '@storybook/react-native'

// https://github.com/storybookjs/react-native#getstorybookui-options
const StorybookUIRoot = getStorybookUI({})
// const StorybookUIRoot = getStorybookUI({})

export default StorybookUIRoot
// export default StorybookUIRoot
export default null
8 changes: 4 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = {
* @deprecated @storybook/addon-notes (now @storybook/addon-ondevice-notes)
* @todo @storybook/addon-links example then PR to storybookjs/react-native
*/
'@storybook/addon-ondevice-actions', // dev/peerDep @storybook/addon-actions
'@storybook/addon-ondevice-backgrounds',
'@storybook/addon-ondevice-controls', // devDep @storybook/addon-knobs, peerDep @storybook/addon-controls
'@storybook/addon-ondevice-notes' // NB: https://github.com/storybookjs/react-native/issues/24#issuecomment-615934280
// '@storybook/addon-ondevice-actions' // dev/peerDep @storybook/addon-actions
// '@storybook/addon-ondevice-backgrounds'
// '@storybook/addon-ondevice-controls', // devDep @storybook/addon-knobs, peerDep @storybook/addon-controls
// '@storybook/addon-ondevice-notes' // NB: https://github.com/storybookjs/react-native/issues/24#issuecomment-615934280
/**
* NB: Docs 12mo OOD w 404 example, get working then PR update
* Should be pos since @storybook/addon-ondevice-knobs@npm:next resolving to 6.0.0-alpha.0
Expand Down
6 changes: 3 additions & 3 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

// import { FC } from 'react'
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds'
// import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds'
import { StyleSheet, View } from 'react-native'
// import type { DecoratorFunction } from '@storybook/addon-actions'

Expand All @@ -18,8 +18,8 @@ export const decorators = [
<View style={styles.container}>
<StoryFn />
</View>
),
withBackgrounds
)
// withBackgrounds
]

export const parameters = {
Expand Down
50 changes: 25 additions & 25 deletions .storybook/storybook.requires.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/* do not change this file, it is auto generated by storybook. */
// /* do not change this file, it is auto generated by storybook. */

import {
configure,
addDecorator,
addParameters,
addArgsEnhancer,
} from "@storybook/react-native";
// import {
// configure,
// addDecorator,
// addParameters,
// addArgsEnhancer
// } from '@storybook/react-native'

import "@storybook/addon-ondevice-actions/register";
import "@storybook/addon-ondevice-backgrounds/register";
import "@storybook/addon-ondevice-controls/register";
// import "@storybook/addon-ondevice-notes/register";
// import "@storybook/addon-ondevice-knobs/register";
// // import '@storybook/addon-ondevice-actions/register'
// // import "@storybook/addon-ondevice-backgrounds/register";
// // import "@storybook/addon-ondevice-controls/register";
// // import "@storybook/addon-ondevice-notes/register";
// // import "@storybook/addon-ondevice-knobs/register";

import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs";
// import { argsEnhancers } from '@storybook/addon-actions/dist/modern/preset/addArgs'

import { decorators, parameters } from "./preview";
// import { decorators, parameters } from './preview'

if (decorators) {
decorators.forEach((decorator) => addDecorator(decorator));
}
// if (decorators) {
// decorators.forEach(decorator => addDecorator(decorator))
// }

if (parameters) {
addParameters(parameters);
}
// if (parameters) {
// addParameters(parameters)
// }

argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
// argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer))

const getStories = () => {
return [];
};
// const getStories = () => {
// return []
// }

configure(getStories, module, false);
// configure(getStories, module, false)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/clsx-npm-1.1.1-362bec0598-ff05265032.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ora-npm-3.4.0-1c83c64050-f1f8e7f290.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/sax-npm-1.2.4-178f05f12f-d3df7d32b8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/uuid-npm-7.0.3-2b088bd924-f5b7b5cc28.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions ReactotronConfig.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import AsyncStorage from '@react-native-async-storage/async-storage'
// eslint-disable-next-line import/no-extraneous-dependencies
import Reactotron from 'reactotron-react-native'

Reactotron.setAsyncStorageHandler?.(AsyncStorage)
.configure() // controls connection & communication settings
Reactotron.configure() // controls connection & communication settings
.useReactNative({
storybook: true
}) // add all built-in react native plugins
Expand Down
7 changes: 1 addition & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
apply plugin: "com.android.application"

apply plugin: "com.facebook.react"

react {
reactRoot = rootProject.file("../node_modules/react-native/")
codegenDir = rootProject.file("../node_modules/react-native-codegen/")
}

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
Expand Down Expand Up @@ -273,7 +268,7 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

implementation project(":ReactAndroid") // From node_modules

// https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
// https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/package-summary
// https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-main/swiperefreshlayout/swiperefreshlayout
Expand Down
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import org.apache.tools.ant.taskdefs.condition.Os

buildscript {
ext {
buildToolsVersion = "33.0.0 rc2"
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24+ which added support for aarch64
ndkVersion = "25.0.8221429 rc2"
ndkVersion = "24.0.8215888"
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// For Android Users, we need to use NDK 23, otherwise the build will
// fail due to paths longer than the OS limit
Expand All @@ -29,9 +29,9 @@ buildscript {
}
dependencies {
// https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google
classpath("com.android.tools.build:gradle:7.3.0-alpha09")
classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.5")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand All @@ -30,7 +30,7 @@ FLIPPER_VERSION=0.142.0
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
reactNativeArchitectures=arm64-v8a

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
# https://services.gradle.org/distributions
# https://gradle.org/nightly
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.5-20220331233901+0000-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
37 changes: 0 additions & 37 deletions jest/setup.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1 @@
jest.mock('@storybook/react-native', () => ({
addDecorator: jest.fn(),
configure: jest.fn(),
getStorybookUI: jest.fn()
}))
jest.mock('@storybook/addon-ondevice-controls', () => ({
register: () => jest.fn()
}))
jest.mock('@storybook/addon-ondevice-notes', () => ({
/**
* TODO: Figure why Jest unable to mock this
* It's import in codegen'ed storybook.requires.js commented for snaphot till then
*/
register: () => jest.fn()
}))
jest.mock('@storybook/addon-actions/dist/modern/preset/addArgs', () => ({
argsEnhancers: {
/**
* TODO: Figure why Jest unable to parse Array.prototype.forEach()
* e.g. argsEnhancers: []
* Jest config likely needs ES version bump or polyfill
*/
forEach: jest.fn()
}
}))
jest.mock('@storybook/react-native', () => ({
addDecorator: jest.fn(),
addParameters: jest.fn(),
configure: jest.fn(),
getStorybookUI: jest.fn()
}))
// @storybook/addon-ondevice-knobs
jest.mock('react-native-color-picker', () => jest.fn())
jest.mock('react-native-switch', () => jest.fn())
jest.mock('@storybook/addon-ondevice-knobs', () => ({
register: () => jest.fn()
}))
export {}
21 changes: 2 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,9 @@
"clean": "react-native-clean-project"
},
"dependencies": {
"@react-native-async-storage/async-storage": "1.17.3",
"@react-native-community/checkbox": "0.5.12",
"@react-native-community/datetimepicker": "6.1.2",
"@react-native-community/slider": "4.2.2",
"@react-navigation/native": "6.0.10",
"@react-navigation/native-stack": "6.6.2",
"react": "experimental",
"react-native": "0.68.1",
"react-native-codegen": "0.0.14",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "3.13.1",
"react-query": "3.34.20"
"react-native": "nightly",
"react-native-codegen": "0.0.14"
},
"devDependencies": {
"@babel/core": "7.17.9",
Expand All @@ -54,15 +45,8 @@
"@storybook/addon-knobs": "6.4.0",
"@storybook/addon-links": "6.4.22",
"@storybook/addon-notes": "next",
"@storybook/addon-ondevice-actions": "next",
"@storybook/addon-ondevice-backgrounds": "next",
"@storybook/addon-ondevice-controls": "next",
"@storybook/addon-ondevice-knobs": "next",
"@storybook/addon-ondevice-notes": "next",
"@storybook/addons": "6.4.22",
"@storybook/eslint-config-storybook": "3.1.2",
"@storybook/linter-config": "3.1.2",
"@storybook/react-native": "next",
"@storybook/react-native-server": "next",
"@swc/core": "1.2.171",
"@swc/wasm": "1.2.171",
Expand Down Expand Up @@ -103,7 +87,6 @@
"react-codemod": "5.4.3",
"react-dom": "experimental",
"react-native-clean-project": "4.0.1",
"react-native-flipper": "0.142.0",
"react-native-gradle-plugin": "0.0.6",
"react-native-rename": "2.9.0",
"react-test-renderer": "experimental",
Expand Down
4 changes: 1 addition & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
ReloadInstructions
} from 'react-native/Libraries/NewAppScreen'

import StorybookUIRoot from '../.storybook/Storybook'

if (__DEV__) {
import('../ReactotronConfig')
.then(() => {
Expand Down Expand Up @@ -120,7 +118,7 @@ const styles = StyleSheet.create({
})

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, no-constant-condition
export default false ? StorybookUIRoot : App
export default App

// export default Reactotron.storybookSwitcher(storybook)(App)
// https://github.com/infinitered/reactotron/issues/1160
17 changes: 0 additions & 17 deletions storybook/stories/Button/index.android.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions storybook/stories/Button/index.d.ts

This file was deleted.

17 changes: 0 additions & 17 deletions storybook/stories/Button/index.ios.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions storybook/stories/CenterView/index.tsx

This file was deleted.