Code Monkey home page Code Monkey logo

pepperoni-app-kit's Introduction

Pepperoni - Empowered by Futurice Futurice React Native Starter Kit

Join the chat at https://gitter.im/futurice/pepperoni-app-kit Build Status React Native Sponsored License

⚠️ Deprecation Warning

Dear community, as time moved on so did React Native and we've not been able to provide continous support for pepperoni in the past. We are happy that so many of you found it useful and are looking forward to build new tools in the future.

If you are new to React Native and are looking for ways how to start, Expo is a great choice or head straight to the React Native docs as it's never been easier to get started with the official setup.

Intro

We 💚 building apps with React Native, because it helps us create high quality products for both major mobile platforms quickly and cost-effectively.

Getting started on a new app just takes too damn long, though. Most apps need the same basic building blocks and developer infrastructure, and we are bored of reinventing the wheel time and time again.

This Starter Kit reflects the best practices of React Native development we have discovered while building real-world applications for our customers. It is opinionated about tooling, patterns and development practices. It might not be a one-size-fits-all solution for everyone, but feel free to customize it for your needs, or just take inspiration from it.

React Native Starter Kit is a part of Pepperoni, a framework for kickstarting digital product development.

tltr;

Sounds good and you just want to see how it works? Here is a quick start guide:

git clone https://github.com/futurice/pepperoni-app-kit.git
cd pepperoni-app-kit
yarn install
react-native run-ios

For further setup instructions please see our Getting Started section.

Contents

⚠️ WORK IN PROGRESS | :star: COMING SOON

Not all of the below is yet fully implemented

Application Blueprint

  • Always up-to-date React Native scaffolding
  • Modular and well-documented structure for application code
  • Redux and ImmutableJS for safe and Reasonaboutable™️ state management
  • Redux Loop for Elm-style controlled side effects
  • React Navigation for awesome navigation with 60fps transitions
  • Disk-persisted application state caching for offline support and snappy startup performance
  • Clean and testable service layer for interacting with RESTful APIs
  • ⚠️ Sample app to show how to wire it all together
  • ⭐ JSON Web Token authentication
  • ⭐ Multi-environment configuration (dev, staging, production) for iOS and Android
  • ⭐ Built-in error handling and customizable error screens

Testing Setup

  • Jest for unit testing application code and providing coverage information.
  • Enzyme and fully mocked React Native for unit testing UI components
  • Utilities for end-to-end integration testing Redux state, including side effects and asynchronous actions

Development & Deployment Infrastructure

Roadmap

  • TODOMicrosoft Code Push for instant JavaScript and images update
  • TODO Crash reporting
  • TODO Android and iOS UI Testing with Calaba.sh?
  • TODO Feature flags?

Getting started

To build your own app on top of the Starter Kit, fork or mirror this repository. For serious use we recommend mirroring using these instructions, since you can't make a fork of a public repository private on GitHub. To contribute to Starter Kit development or just playing around, forking is the way to go.

First, give your application a name by running ./support/rename.sh YourAppName.

Once you have the code downloaded, follow the Setup guide to get started.

Development workflow

After you have set up the project using above instructions, you can use your favorite IDE or text editor to write code, and run the application from the command line. Turn on React Native hot module reloading in the app developer menu to update your application as you code.

To learn how to structure your application and use the Redux application architecture, read the Architecture guide for more details.

Start the application in iOS simulator
$ react-native run-ios
Start the application in Android simulator

(If using the stock emulator, the emulator must be running)

$ react-native run-android
Run unit tests
$ npm test
Run tests every time code changes
$ npm run test:watch
Generate code coverage report
$ npm run coverage

Read the Testing guide for more information about writing tests.

Debugging

For standard debugging select Debug JS Remotely from the React Native Development context menu (To open the context menu, press CMD+D in iOS or D+D in Android). This will open a new Chrome tab under http://localhost:8081/debugger-ui and prints all actions to the console.

For advanced debugging under macOS we suggest using the standalone React Native Debugger, which is based on the official debugger of React Native. It includes the React Inspector and Redux DevTools so you can inspect React views and get a detailed history of the Redux state.

You can install it via brew and run it as a standalone app:

$ brew update && brew cask install react-native-debugger

Note: Make sure you close all active chrome debugger tabs and then restart the debugger from the React Native Development context menu.

Deployment

Read the Deployment guide to learn how to deploy the application to test devices, app stores, and how to use Code Push to push updates to your users immediately.

Contributing

If you find any problems, please open an issue or submit a fix as a pull request.

We welcome new features, but for large changes let's discuss first to make sure the changes can be accepted and integrated smoothly.

License

MIT License

Credits

This project was initially motivated by Snowflake, a React Native boilerplate by Barton Hammond. It shares some features and design principles for Pepperoni, but it wasn't the right fit for our needs. At this time Snowflake is more mature, so if you like Pepperoni but didn't agree with something we are doing, you should check it out to see if it's a good fit for your app.

pepperoni-app-kit's People

Contributors

alnorris avatar chadrien avatar clauderic avatar danieljharvey avatar dependabot[bot] avatar duddu avatar fabriziomoscon avatar fruitiex avatar gitter-badger avatar hineshmandalia avatar ianko avatar janivihervas avatar jevakallio avatar justinwoo avatar kimmobrunfeldt avatar krivachy avatar lapanti avatar lvarayut avatar mkauppila avatar sercanov avatar shamilik avatar tehmou avatar tino-junge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pepperoni-app-kit's Issues

Error while building the ios app

I can build some other react native projects, but when i am building pepperoni i am getting following error:

`=== BUILD TARGET RCTVibration OF PROJECT RCTVibration WITH CONFIGURATION Debug ===

Check dependencies

** BUILD FAILED **

The following build commands failed:
CompileC /Users/mm/Personal/projects/pepperoni-app-kit/ios/build/Build/Intermediates/A0RNLock.build/Debug-iphonesimulator/A0RNLock.build/Objects-normal/x86_64/A0LockReact.o A0RNLock/Core/A0LockReact.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/Kindling.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/mm/Personal/projects/pepperoni-app-kit/node_modules/react-native/node_modules/promise/lib/done.js:10
throw err;
^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/Kindling.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

at checkExecSyncError (child_process.js:441:13)
at Object.execFileSync (child_process.js:461:13)
at _runIOS (runIOS.js:91:34)
at runIOS.js:24:5
at tryCallTwo (/Users/mm/Personal/projects/pepperoni-app-kit/node_modules/react-native/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/mm/Personal/projects/pepperoni-app-kit/node_modules/react-native/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/mm/Personal/projects/pepperoni-app-kit/node_modules/react-native/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/mm/Personal/projects/pepperoni-app-kit/node_modules/react-native/local-cli/cli.js:87:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)`

File structure advice

I need three different screens that are related to the domain "project". The screens are:

  • ProjectList (whole screen is a list)
  • Project (screen shows a single project)
  • ProjectCompact (half top of the screen shows project info, bottom half shows list of connected detail.

Would you throw all of these screens in the same module folder, i.e. "project"? In that case, should I merge the state handling into one single file, but have the views and viewcontainers as separate files?

I know there are endless discussions of folder structure at various forums. I like the Pepperoni structure best (Ducks, domain centric, decoupled) and I'd really like to follow a "Pepperoni best practice" if there is one.

Awesome kit! Some questions..

I'm new to React-Native and I've spent the last couple of weeks on reading up and testing stuff. Everything is awesome, except there is no "best practice" to find anywhere. I'm struggling to find my own way of organizing files, organizing Redux, Navigate between views, etc.

Pepperoni with it's nice documentation gives me a great foundation and best practice. I like almost everything (Redux, Ducks, Coding style, etc), but maybe not Immutable.js. I'll give Immutable a good try though.

I have a couple of concerns:
1. Local storage and memory consumption of Redux Store.
Since AsyncStorage is used to save the complete state of the app as one big blob, there is no way to load the initial state (i.e. last snapshot) in a prioritized order. I was about to use SQLite or something for local storage, since I'll have a lot of data in the app.

  • How much data is reasonable to have in the Redux State? Should I throw out old data after a while and force the app to refetch this from the server when/if it's needed again?
  • I'll have a lot of image files in my app. Those are synced with the server and lives as files on the device local disk. My plan is to reference those files from the Redux State as kind of foreign keys (UUID). I'm thinking of having a separate slice in the state for images, but only for metadata such as isLoaded, etc. Does this make sense?

2. Upgrading
I assume/hope that Pepperoni will continue to evolve. What is the preferred concept of upgrading apps based on Pepperoni?

  • Are there distinct places/files in Pepperoni which could be upgraded?
  • Or would upgrading take a large amount of diff checking and merging?

3. dependencies
pod install got me a bunch of Cocoa Pods. Where are those used in Pepperoni? I have never used pods before. Are there similar Android "pods" available, or will these pods make the app single-platform?

Requiring unknown module "../../env"

Running on Android(5.0) physical device, React-Native(0.26), npm(3.6.0), Windows -7. I am able to deploy the debug apk to physical device but getting the below error,

Requiring unknown module "../../env". If you are sure the module is there, try restarting the packager or running npm install.

I did both but keep on getting the same error. Any idea, what is causing this error?

Setup step fails

Could you clarify the setup?

$ rnpm link react-native-lock
Preparing to link react-native-lock for iOS
Checking CocoaPods...
CocoaPods already installed
rnpm-link info Android module react-native-lock is already linked
rnpm-link info iOS module react-native-lock is already linked
Checking Podfile in iOS project (/Users/alekje/code/fp/react-native-accounting-thing/ios/Podfile)

Found an existing Podfile, Do you want to override it? [N/y]
n
Add the following pods:


pod 'Lock', '~> 1.24'
pod 'Lock/TouchID'
pod 'Lock/SMS'
pod 'Lock/Email'

and run 'pod install' to install Lock for iOS
$ pod install
[!] No `Podfile' found in the project directory.
$ (cd ios; pod install)
Re-creating CocoaPods due to major version update.
Analyzing dependencies
[!] The dependency `Lock (~> 1.24)` is not used in any concrete target.
The dependency `Lock/TouchID` is not used in any concrete target.
The dependency `Lock/SMS` is not used in any concrete target.
The dependency `Lock/Email` is not used in any concrete target.

env.js Setup clarification

The Setup Guide has:

AUTH0_CLIENT_ID: '<CLIENT_ID>',
AUTH0_NAMESPACE: '<APP_NAME>.eu.auth0.com'

In Auth0 Application Settings, there is no "NameSpace" but there is "Domain" as shown below. Does NAMESPACE === DOMAIN? If so, maybe updating docs and code would be worthwhile. If not, some clarification should be provided to explain what/where this NAMESPACE value is.

screen shot 2016-05-31 at 4 31 01 pm

npm install fails, don't have public key for react-native-lock

The "react-native-lock" package requires ssh access in order to compile, is this the expected behavior? If so what should the workaround be? We've tried removing it from the package.json and installing running npm install on the "react-native-lock" lib separately, but we believe that's leading us to an A0RNLock issue.

Cannot `npm install` the application

I am getting an "Permission denied" error:

`npm install
Password:
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is SHA256:xxxxxx.
//e you sure you want to continue connecting (yes/no)? -
npm ERR! git fetch -a origin (ssh://[email protected]/futurice/react-native-lock.git) Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
npm ERR! git fetch -a origin (ssh://[email protected]/futurice/react-native-lock.git) Permission denied (publickey).
npm ERR! git fetch -a origin (ssh://[email protected]/futurice/react-native-lock.git) fatal: Could not read from remote repository.
npm ERR! git fetch -a origin (ssh://[email protected]/futurice/react-native-lock.git)
npm ERR! git fetch -a origin (ssh://[email protected]/futurice/react-native-lock.git) Please make sure you have the correct access rights
npm ERR! git fetch -a origin (ssh://[email protected]/futurice/react-native-lock.git) and the repository exists.
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.3
npm ERR! npm v2.14.7
npm ERR! code 128

npm ERR! Command failed: git fetch -a origin
npm ERR! Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues`

Alternative Router

I'm sure it was intentional, so if nothing else, just curiosity. Why the choice to use a custom router instead of something like react-native-router-flux?

navigationState duplicate key when restarting the app after an error

@jevakallio
I reproduced the scene stack error I mentioned to you at the meetup. This happens when I open the app after another error occurred. So I guess leaving some dirty state in the application.
Contacts is the name of the route. To clear this error I have to clean manually the data cache for the app.

Possible Unhandled Promise Rejection (id: 0):
navigationState.children[2].key "scene_Contacts" conflicts withanother child!
Invariant Violation: navigationState.children[2].key "scene_Contacts" conflicts withanother child!
    at invariant (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:2433:7)
    at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:71833:1
    at Array.forEach (native)
    at NavigationScenesReducer (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:71825:20)
    at new NavigationAnimatedView (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:71457:8)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:28503:19)
    at ReactCompositeComponentWrapper._constructComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:28485:13)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:28404:15)
    at Object.mountComponent (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:26913:29)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:28580:28)

UPDATE:

This happens when inside the NavigationState another children with the same key gets pushed

using the chrome debug console:

// prev state state
Object NavigationState = {
   MainNavigation: {
      routes: [
         {key: 'pageA'},
         {key: 'pageB'},
      ]
  }
}

// next state
Object NavigationState = {
   MainNavigation: {
      routes: [
         {key: 'pageA'},
         {key: 'pageB'},
         {key: 'pageB'},
      ]
  }
}

// NOTE: the key `routes` is called `children` with react-native < 0.28

navigationstate

Drop semicolons

Since this kit gives opinion on linting rules and is becoming fairly popular I'm curious if you'd entertain a PR to drop the semicolons (a fixable rule using --fix)? JS is easier to read and write without semicolons.

Developer workflow

I have successfully installed the project and I have it running on a virtual device. Thanks for the clear instructions!

However, there is something not clear in the Developer Workflow section:

"After you have set up the project using above instructions, you can use your favorite IDE or text editor to write code, and run the application from the command line. Turn on React Native hot module reloading in the app developer menu to update your application as you code."

What/Where is exactly the "app developer menu" ?

Thanks!

[DISCUSSION] upgrade Navigation [waiting for stability on NavigationExperimental]

UPDATE:
the repo mentioned below is no longer a good example considering all the breaking changes the folks at Facebook are making on the NavigationExperimental.
It is better to wait after 0.29 becomes stable to make any change on the navigation.

NavigationExperimental has changes in 0.30
https://github.com/facebook/react-native/releases/tag/v0.30.0-rc.0

I think the current navigation could be improved and made it compatible with those changes. I was checking out this repo (whcih uses react-native#master https://github.com/jlyman/RN-NavigationExperimental-Redux-Example/blob/master/package.json#L12):

and notice few nice things in my opinion:

what's your opinion on this @jevakallio

A good background giving context could be found here:

Reason for node.js >= 5?

What is the reason for needing Node >=5 as stated in the setup guide? I'd rather stick with LTS version for production (4.4.7 for the moment). Everything seems to work fine with 4.4.7.

Can't run this on 0.26 - naming collision

Hi,

I have tried it on 0.26 today and I couldn't make the "npm start" and it throws me an error as below,

Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: ReactDOMOption
Paths: /home/sid/react/pepperoni-app-kit/node_modules/react/lib/ReactDOMOption.js collides with /home/sid/react/pepperoni-app-kit/node_modules/react-native-mock/node_modules/react/lib/ReactDOMOption.js

This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
Duplicate module name: ReactDOMOption
Paths: /home/sid/react/pepperoni-app-kit/node_modules/react/lib/ReactDOMOption.js collides with /home/sid/react/pepperoni-app-kit/node_modules/react-native-mock/node_modules/react/lib/ReactDOMOption.js

This error is caused by a @providesModule declaration with the same name accross two different files.
at HasteMap._updateHasteMap (/home/sid/react/pepperoni-app-kit/node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:160:15)
at /home/sid/react/pepperoni-app-kit/node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:125:25

Missing documentation

There should be documentation on the fact that the app won't work if you don't have network (auth0 complains on Android about missing configuration)

Build failed on ios

Hi Pepperoni team,

I might look dumb but i can't get the starter kit to build on an iPhone. Everything works great into the simulator, but here's logs when I try to build it on a real device :

ld: warning: directory not found for option '-L/Users/wt/Library/Developer/Xcode/DerivedData/test-gifqqwfpbaeomfhauvvrnvrqarmi/Build/Products/Debug-iphoneos/AFNetworking'
ld: warning: directory not found for option '-L/Users/wt/Library/Developer/Xcode/DerivedData/test-gifqqwfpbaeomfhauvvrnvrqarmi/Build/Products/Debug-iphoneos/CocoaLumberjack'
ld: warning: directory not found for option '-L/Users/wt/Library/Developer/Xcode/DerivedData/test-gifqqwfpbaeomfhauvvrnvrqarmi/Build/Products/Debug-iphoneos/Lock'
ld: warning: directory not found for option '-L/Users/wt/Library/Developer/Xcode/DerivedData/test-gifqqwfpbaeomfhauvvrnvrqarmi/Build/Products/Debug-iphoneos/Masonry'
ld: warning: directory not found for option '-L/Users/wt/Library/Developer/Xcode/DerivedData/test-gifqqwfpbaeomfhauvvrnvrqarmi/Build/Products/Debug-iphoneos/SimpleKeychain'
ld: warning: directory not found for option '-L/Users/wt/Library/Developer/Xcode/DerivedData/test-gifqqwfpbaeomfhauvvrnvrqarmi/Build/Products/Debug-iphoneos/TouchIDAuth'
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What am I missing ? I tried to re-run pod install, re-init project, nothing... Any ideas ?

Thanks for your help and your work on this kit !

Pod install fails

When i ran pod install, i got [!] Unable to find a specification for TouchIDAuth (~> 0.1) depended upon by Lock/TouchID.

Error to build iOS app on fresh clone

Might related to #25

Error:

=== BUILD TARGET PepperoniAppTemplate OF PROJECT PepperoniAppTemplate WITH CONFIGURATION Debug ===

Check dependencies

PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock build/Build/Intermediates/PepperoniAppTemplate.build/Debug-iphonesimulator/PepperoniAppTemplate.build/Script-64ECB2A37DD1E0D254C2E832.sh
    cd /tmp/pepperoni-app-kit/ios
    /bin/sh -c /tmp/pepperoni-app-kit/ios/build/Build/Intermediates/PepperoniAppTemplate.build/Debug-iphonesimulator/PepperoniAppTemplate.build/Script-64ECB2A37DD1E0D254C2E832.sh

Ld build/Build/Products/Debug-iphonesimulator/PepperoniAppTemplate.app/PepperoniAppTemplate normal x86_64
    cd /tmp/pepperoni-app-kit/ios
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/wjiang/.rvm/gems/ruby-2.3.1/bin:/Users/wjiang/.rvm/gems/ruby-2.3.1@global/bin:/Users/wjiang/.rvm/rubies/ruby-2.3.1/bin:/Users/wjiang/.rvm/bin:/Users/wjiang/.nvm/versions/node/v6.3.0/bin:/Users/wjiang/workspace/go/bin:/usr/local/heroku/bin:/Users/wjiang/.rbenv/shims:/Users/wjiang/.rbenv/shims:/Users/wjiang/.rbenv/bin:/Developer/NVIDIA/CUDA-7.5/bin:/Users/wjiang/opt/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Library/TeX/texbin:/Users/wjiang/opt/android/sdk/tools:/Users/wjiang/opt/android/sdk/platform-tools:/Users/wjiang/workspace/go/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin:/Applications/Android Studio.app/sdk/tools:/Users/wjiang/opt/gradle-2.1/bin:/Users/wjiang/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/AFNetworking -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/CocoaLumberjack -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/Lock -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/Masonry -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/SimpleKeychain -L/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/TouchIDAuth -F/tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator -filelist /tmp/pepperoni-app-kit/ios/build/Build/Intermediates/PepperoniAppTemplate.build/Debug-iphonesimulator/PepperoniAppTemplate.build/Objects-normal/x86_64/PepperoniAppTemplate.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=7.0 -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lc++ -ObjC -lAFNetworking -lCocoaLumberjack -lLock -lMasonry -lSimpleKeychain -lTouchIDAuth -framework CoreGraphics -framework Foundation -framework LocalAuthentication -framework MobileCoreServices -framework Security -framework SystemConfiguration -framework UIKit -framework WebKit -fobjc-arc -fobjc-link-runtime /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libReact.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTImage.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTLinking.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTSettings.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTText.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTVibration.a /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -lA0RNLock -lPods-PepperoniAppTemplate -Xlinker -dependency_info -Xlinker /tmp/pepperoni-app-kit/ios/build/Build/Intermediates/PepperoniAppTemplate.build/Debug-iphonesimulator/PepperoniAppTemplate.build/Objects-normal/x86_64/PepperoniAppTemplate_dependency_info.dat -o /tmp/pepperoni-app-kit/ios/build/Build/Products/Debug-iphonesimulator/PepperoniAppTemplate.app/PepperoniAppTemplate
ld: library not found for -lA0RNLock
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld build/Build/Products/Debug-iphonesimulator/PepperoniAppTemplate.app/PepperoniAppTemplate normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/PepperoniAppTemplate.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/private/tmp/pepperoni-app-kit/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/PepperoniAppTemplate.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:475:13)
    at Object.execFileSync (child_process.js:495:13)
    at _runIOS (/private/tmp/pepperoni-app-kit/node_modules/react-native/local-cli/runIOS/runIOS.js:91:28)
    at /private/tmp/pepperoni-app-kit/node_modules/react-native/local-cli/runIOS/runIOS.js:24:1
    at tryCallTwo (/private/tmp/pepperoni-app-kit/node_modules/promise/lib/core.js:45:5)
    at doResolve (/private/tmp/pepperoni-app-kit/node_modules/promise/lib/core.js:200:13)
    at new Promise (/private/tmp/pepperoni-app-kit/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (/private/tmp/pepperoni-app-kit/node_modules/react-native/local-cli/runIOS/runIOS.js:23:8)
    at Object.run (/private/tmp/pepperoni-app-kit/node_modules/react-native/local-cli/cliEntry.js:95:11)
    at Object.<anonymous> (/Users/wjiang/.nvm/versions/node/v6.3.0/lib/node_modules/react-native-cli/index.js:88:7)
/tmp/pepperoni-app-kit $

Steps to reproduce the error:

  1. git clone https://github.com/futurice/pepperoni-app-kit
  2. cd pepperoni-app-kit && npm install
  3. cp env.example.js env.js
  4. cd ios && pod repo update && pod install && cd -
  5. react-native run-ios

Versions:

  • node: v6.3.0
  • npm: v3.10.3
  • ruby: v2.3.1
  • pod: 1.0.1
  • react-native-cli: v1.0.0
  • react-native: v0.29.0

Replace TabBar with DrawerLayoutAndroid

Hello! Thank you for this amazing starter kit!

I spent almost all day trying to replace TabBar with DrawerLayoutAndroid. I can't get it works properly. I created this function in NavigationView rendering:

_renderAndroidDrawer() {
  const {children, index} = this.props.navigationState;

  const navigationView = (
    <View style={{flex: 1}}>
      <SideMenu
        switchTab={(tabIndex) => {
          this.props.switchTab(tabIndex);
          this.refs['DRAWER_REF'].closeDrawer();
        }}
        items={children}
      />
    </View>
  );

  return (
    <DrawerLayoutAndroid
      ref={'DRAWER_REF'}
      drawerWidth={300}
      drawerPosition={DrawerLayoutAndroid.positions.Left}
      renderNavigationView={() => navigationView}>
      <NavigationTabView
        router={AppRouter}
        navigationState={children[index]}
        onNavigate={this.props.onNavigate}
      />
    </DrawerLayoutAndroid>
  );
}

In SideMenu component I'm calling this switchTab function

{
  this.props.items.map((item, index) => {
    return (
      <MenuButton
        key={`menu-button-${index}`}
        top={index === 0}
        title={item.title}
        onPress={ this.props.switchTab.bind(this, index) }
      />
    )
  })
}

And now the behaviour is weird. When I switch tabs in the Drawer only navigator headers are changing. Page content is still the same. But only the visible view are the same (buttons from the new page work). It will be better it I'll try to explain it with an example.

  • I'm at the Home page from the example. I see counter with three buttons (Reset, Random, Bored)
  • Clicking at the Profile button in the drawer menu.
  • Navigation header changed to 'Profile' but I still see counter and three buttons. But this buttons doesn't work. If I'll tap on the center of the screen I'll see View #1 from the profile (with navigator transition). Seems like I was on the Profile page, but I saw the content of the Home page.
  • I can click back in navigator header and I'll see Profile page #0.
  • I can switch to the Home page using drawer.
  • goto step 1.

I'm sorry if the description is not clear. But can you help me a bit? Am I doing something wrong with the application Architecture? Do I need to implement this Drawer in different place?

Thanks!

How to replace Auth0

Auth0 seems to have its own modal forms for authentication. I want to use my own authentication on my own server and I want to build the forms myself.

  1. How would be the best way to get rid of Auth0. I'm worried that if I tamper too much with the code I'll have an even harder time when I want to cherry pick/merge newer pepperoni versions.
  2. I want my login screens (signin/signup/reset/etc) at the root of the navigation. But I also want to use tabs in the main screen. How would be a good way to implement this?

Would the following make sense?
I'll have two roots. I.e. at initialization I'll just have my login route in the navigationState, but after a successful authentication I would force a new "initialState" upon the navigator. Also, a logout would clear the navigation state again and reinstate the initial login route.

Thanks.

How to update a project?

Hi,
What is the procedure and what are the best practices to update an existing project ?
Would be good to have this addressed in the documentation.

The app feels slow for iPhone 5S (debug mode)

Hey Guys,
my first experiments with RN was a very simple Tabs Apps without stores and so on.
Then I discovered pepperoni with all the good practices and the proper architecture.

But my first impression on a device is, that the app feels very slow on an iPhone 5S!

Has somebody else the same feeling?

Thanks for the Credits

Thanks for mentioning Snowflake in your Credits. It makes me very happy that it was helpful to your project.

Best of luck!

Please close after reading...

Required prop onNavigate

I just pulled a new version of Pepperoni (b49d6db) into my project. Some problems/questions arose.

  1. onNavigate is replaced by onNavigateBack, but NavigationCard and NavigationAnimatedView seems to need onNavigate as per their required props. Should I ignore this for now?
  2. I just upgraded Flow to 0.28. Pulling from Pepperoni put the .flowconfig back to 0.27. Any reason for this? Should I stick with 0.27?

Thank you all for giving me a flying start with my app!

First Use Experience

First user experience is a core feature of Pepperoni, and needs a lot of love to make it better.

One idea would be to emulate the react-boilerplate first use experience with npm run setup and npm run clean type commands.

Session vs Auth vs. User

There are many modules that I feel have much in common. I find myself having a hard time to chose which module to use. This might be a sign of too many modules or a sign of me misunderstanding the meaning.

Is there any documentation on this somewhere? I haven't found anything in the docs.

Auth:
Auth0 takes a profile (I assume this is a user profile) and saves it to the store. I'm replacing this with my own module Authentication, but the same things will be handled, including screens for singin/signup/password reset/etc.

Session:
Session seems to only handle snapshots. But I would think that initializeSessionState would also be responsible for resetting the credentials, i.e. logout.

User:
I have a user module where I keep the user's profile page, avatar, etc. I also need some screens for administering other user's access rights (if you are an admin). I'll probably keep those screens in the User module.

I suppose everything would make sense to me if I could read about the thoughts behind the structure in the docs. So, I guess this is a feature request for more documentation =)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.