Skip to content

Commit

Permalink
Replacing __DEV__ with process.env.NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarNestorov committed Aug 7, 2020
1 parent b09fdd2 commit fd01e2e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 24 deletions.
14 changes: 0 additions & 14 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ target 'example' do
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

target 'exampleTests' do
inherit! :complete
# Pods for testing
end

use_native_modules!

# Enables Flipper.
Expand All @@ -93,12 +88,3 @@ target 'example' do
flipper_post_install(installer)
end
end

target 'example-tvOS' do
# Pods for example-tvOS

target 'example-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,6 @@ SPEC CHECKSUMS:
Yoga: 9db9ff2025ad21d1ac0a8b3c85d5ac4e7c29d525
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 56c2537f71f3f02200d6918c542a8e89a0b422fa
PODFILE CHECKSUM: 35ce0533b627f4404f5562fe748e68c1d5b57041

COCOAPODS: 1.9.3
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"postinstall": "is-macos && pod install || true",
"postinstall": "pod-install",
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start"
Expand All @@ -15,6 +15,6 @@
},
"devDependencies": {
"@types/react": "^16.9.38",
"is-macos": "^0.0.1"
"pod-install": "^0.1.9"
}
}
2 changes: 1 addition & 1 deletion library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-dynamic",
"version": "1.0.0-rc.4",
"version": "1.0.0",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"repository": "[email protected]:codemotionapps/react-native-dynamic.git",
Expand Down
8 changes: 7 additions & 1 deletion library/src/dynamic-style-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { IndexedObject, ValueOf } from 'toolkit.ts'
import { DynamicValue, useDynamicValue } from './dynamic-value'
import { Mode } from './types'

declare const process: {
env: {
NODE_ENV: string
}
}

type Style = ViewStyle | TextStyle | ImageStyle

type DynamicStyle<T extends Style> = { [Key in keyof T]: T[Key] | DynamicValue<T[Key]> }
Expand Down Expand Up @@ -38,7 +44,7 @@ function parseStylesFor<T extends DynamicStyles<T>>(styles: T, mode: Mode): Norm
newStyles[i] = newStyle
}

if (!containsDynamicValues && __DEV__) {
if (!containsDynamicValues && process.env.NODE_ENV !== 'production') {
console.warn(
'A DynamicStyleSheet was used without any DynamicValues. Consider replacing with a regular StyleSheet.',
)
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3341,6 +3341,11 @@ plugin-error@^0.1.2:
arr-union "^2.0.1"
extend-shallow "^1.1.2"

pod-install@^0.1.9:
version "0.1.9"
resolved "https://registry.yarnpkg.com/pod-install/-/pod-install-0.1.9.tgz#c78c4e597072a014297d9185b820339ab3154768"
integrity sha512-NBbJfeVjtGw/1ro6QJYv2aN5XuHTCzLDNlD4EWXMcG9d4hOIB7L1Ie3+ScDmZpENih9SyHO98S8h7Ismk4vxUg==

posix-character-classes@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
Expand Down Expand Up @@ -3423,11 +3428,6 @@ react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react-native-dynamic@*:
version "0.0.0"
resolved "https://registry.yarnpkg.com/react-native-dynamic/-/react-native-dynamic-0.0.0.tgz#0b5c6ab5f1097dc108cf3538aaaecaef2654ff6b"
integrity sha512-2AwT9RR9zWH+Z/YLRnPj4j8pFikYp2+LEvZHTYgPKnm8rbNdUEndHofWkf2vfe3kG8QQi8m14ViiBTfKXvKDPQ==

[email protected]:
version "0.62.0"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.62.0.tgz#166dcab76f0b5ae36a4d7046de2cbfecfdc610f1"
Expand Down

0 comments on commit fd01e2e

Please sign in to comment.