Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile At Wix: Continuous Workflow for a Large ...

Mobile At Wix: Continuous Workflow for a Large React Native App

The Wix app is a large operation involving ~40 developers from 7 different product groups and a pretty big amount of features.
Scaling this project requires code architecture that enables each module to be developed separately, but easily fit the big puzzle.

We’ll discuss the way we do both unit and E2E testing, the way we scale our CI, the way we deploy and how we fix issues in production when they arise.

We’ll also share our plans to how we’re going to scale our app and dev process to support 100 developers a year from today.

Avatar for Rotem Mizrachi-Meidan

Rotem Mizrachi-Meidan

April 13, 2018
Tweet

More Decks by Rotem Mizrachi-Meidan

Other Decks in Programming

Transcript

  1. medium/@rotemmiz github.com/yershalom github.com/rotemmiz @yershalom @rotemmiz [email protected] [email protected] Mobile At Wix

    Shalom Yerushalmy Rotem Mizrachi-Meidan Continuous Workflow for a Large React Native App April 2018
  2. The Wix App § Written from scratch in React Native

    § Started a 24 months ago § 40 developers § 70% JavaScript, 30% Native code § 7 product groups, and growing
  3. Engine . |____app_builds | |____android | | |____dev | |

    | |____WixApp.apk | |____iphonesimulator | | |____dev | | | |____WixApp.app |____img |____src |____ios |____android |____cli |____package.json
  4. module.js export default class DemoModule { init() { } components()

    { return [ { id: 'wix.module.DemoTab’, generator: () => DemoScreen, store, provider: Provider } ]; } methods() { return [ //registered methods ]; } onAppStateChanged(appState) { } }
  5. React Native Navigation Module API JavaScript ObjC, Java, C Native

    extensions Native extensions Native extensions Native/RN extensions / API Views Biz Logic Stores … React Native Feature Config BI Logging … API Views Biz Logic Clubs API Views Biz Logic CRM Modules Engine OS …
  6. CRM Clubs Stores Engine Wix App GA GA GA GA

    RC RC RC RC TestFlight/ Google Play
  7. package.json "dependencies": { "wix-inbox-mobile": "ga", "wix-mobile-media-manager": "ga", "wix-social-chat-mobile": "ga", "wix-one-clubs-feed":

    "ga", "wix-one-clubs-manager": "ga", "wix-store-merchant-app": "ga", "wix-one-app-engine": "ga", ... },
  8. Module Code Change git push Module Build, Test & Version

    Internal Release Wix App Release publish Private Repo upload AppBlade upload TestFlight & GP Module RC Wix App Build & Test RC-GA Wix App RC Wix App Build & Test GA-GA
  9. § Supports patching § Git tree state -> Version 1.423.4

    Major Minor Patch From package.json Number of commits in master Number of commits in branch Versioning Scheme
  10. Frontend Backend Mobile App Module A Biz Logic UI Comp

    Module B Biz Logic UI Comp Production E2E Tests
  11. Production E2E Pros Cons • Real user experience • Easy

    to setup • Easy to write • High confidence • Flaky • Slow • Hard to maintain
  12. Frontend Backend Mobile App Module A Biz Logic UI Comp

    Module B Biz Logic UI Comp Mocked E2E Tests Mock Server
  13. Mocked E2E Pros Cons • Closer to code • Stable

    • Easy to maintain • Hard to setup • Hard to write
  14. module.exports = { LOGIN_ENDPOINT: 'https://login.wix.com' }; endpoint.js module.exports = {

    LOGIN_ENDPOINT: 'https://localhost:90210' }; endpoint.e2e.js
  15. module.exports = { getSourceExts: () => process.env.RN_SRC_EXT ? process.env.RN_SRC_EXT.split(',') :

    [] }; > RN_SRC_EXT=e2e.js react-native start > RN_SRC_EXT=e2e.js xcodebuild <params> > RN_SRC_EXT=e2e.js ./gradlew assembleRelease rn-cli.config.js endpoint.js endpoint.e2e.js
  16. describe('Login', () => { const server = new MockServer(); beforeEach(async

    () => { await server.start(); }); afterEach(async () => { await server.stop(); }); it('should login and persist login after restart', async () => { server.forUser(server.testUserId()).withBusinesses(1); await device.launchApp({ delete: true, permissions: { notifications: 'YES' }}); await element(by.text('Log In TestUser1')).tap(); await expect(element(by.text('feed.FeedScreen'))).toBeVisible(); await device.launchApp({ newInstance: true }); await expect(element(by.text('feed.FeedScreen'))).toBeVisible(); }); });
  17. React Native Navigation Module API JavaScript ObjC, Java, C Native

    extensions Native extensions Native extensions Native/RN extensions / API Views Biz Logic Stores … React Native Feature Config BI Logging … API Views Biz Logic Clubs API Views Biz Logic CRM Modules Engine OS …
  18. “≈0 Manual QA” Developers § Unit tests § Mocked E2E

    § Contract tests QA Engineers § Prod E2E manual backup § Scenarios Developers + QA § Educate § Sync