엑스포와 네이티브 네이티브의 차이점은 무엇입니까?
에서 엑스포 웹 사이트
Expo를 사용하면 웹 개발자는 JavaScript로 한 번만 작성하여 iOS와 Android에서 작동하는 진정한 기본 앱을 만들 수 있습니다.
이것이 React Native의 기능이 아닙니까? 차이점이 뭐야?
나는 엑스포에서 일한다!
코드를 작성할 때 코드 Expo
를 작성 React Native
하십시오. Expo
두 가지 주요 부분이 있습니다.
1) expo-cli
: 프로젝트 생성, 로그보기, 장치 열기, 게시 등을위한 개발자 도구
2) Expo
클라이언트 : 통과 할 필요없이, 당신은 당신이 그들에 작업하는 동안 프로젝트를 열 수 있습니다 휴대 전화 응용 프로그램 XCode
또는 Android Studio
도하고, 다른 사람들이 너무 그들을 볼 수 있습니다! 를 통해 게시하면 사용자는 게시 된 동일한 계정으로 로그인 한 경우 Android 또는 iOS expo-cli
의 Expo
클라이언트를 통해 언제든지 액세스 할 수 있습니다 . 또한, 독립형 앱을 구축하여 사람들이 Expo
클라이언트를 사용하여 앱 을 열 필요가 없으며 원하는 경우 앱 스토어에 배포하고 재생할 수 있습니다.
따라서 Expo
/ around 위에 빌드 된 도구 세트입니다 React Native
. 이러한 툴은 우리가 보유하고있는 하나의 주요 신념에 의존 Expo
합니다. 포괄적 인 API 세트가 노출되어있는 경우 기본 코드를 작성할 필요없이 대부분의 앱을 빌드 할 수 있습니다 Javascript
.
React Native
항상 네이티브 코드로 드롭 다운 할 수 있기 때문에 이것은 중요 합니다. 이것은 때때로 굉장히 도움이되지만 비용이 듭니다. 테스트를 원한다면 사람들에게 바이너리를 보내야합니다. 다른쪽에있는 누군가는 작업하는 동안 링크를 탭할 수 없습니다. 한 번의 클릭으로 브라우저에서와 비슷한 방식으로 액세스 할 수 있습니다.
을 사용 Expo
하면 가능한 경우 기본 코드로 넘어 가지 않도록하십시오. 위에서 언급했듯이에 사용할 수있는 포괄적 인 API 세트를 사용하면 Javascript
대부분의 앱에는 필요하지 않습니다. 따라서이 포괄적 인 API 세트를 제공 한 다음 기본 런타임이 공유되는 세계에 존재할 수있는 모든 멋진 툴링을 구축하는 것을 목표로합니다.
그러나 네이티브로 절대 드롭 다운 해야하는 경우 네이티브 프로젝트에서와 동일한 수준의 제어 ExpoKit
를 Expo
제공하면서 네이티브 API를 계속 사용할 수 있습니다 . " ExpoKit
는 더 큰 표준 네이티브 프로젝트의 일부로 Expo
플랫폼 및 기존 Expo
프로젝트 를 사용할 수있는 Objective-C 및 Java 라이브러리입니다 ." 자세한 내용은 여기를 참조하십시오.
Expo 직원의 설명서 및 답변 요약을 수행하려고했습니다.
네이티브 초기화 반응 :
장점 :
- Java / Objective-C로 작성된 기본 모듈을 추가 할 수 있습니다 (아마 유일하지만 가장 강력한 모듈).
단점 :
- 프로젝트를 실행하려면 Android Studio 및 XCode가 필요합니다.
- Mac이 없으면 iOS 용으로 개발할 수 없습니다
- 테스트를 위해 장치를 사용하려면 USB를 통해 장치를 연결해야합니다
- XCode에서 글꼴을 수동으로 가져와야합니다.
- 앱을 공유하려면 전체 .apk / .ipa 파일을 보내야합니다.
- Push-Notifications, Asset Manager와 같은 JS API를 기본적으로 제공하지 않습니다. 예를 들어 수동으로 설치하고 npm과 연결해야합니다.
- 작업 프로젝트를 올바르게 설정 (장치 구성 포함)하는 것은 다소 복잡하며 시간이 걸릴 수 있습니다
엑스포
장점 :
- 프로젝트 설정은 쉽고 몇 분 안에 완료 할 수 있습니다
- 작업하는 동안 자신과 다른 사람들이 프로젝트를 열 수 있습니다.
- QR 코드 또는 링크를 통해 앱을 쉽게 공유 할 수 있으므로 전체 .apk 또는 .ipa 파일을 보낼 필요가 없습니다.
- 앱을 실행하기 위해 빌드 할 필요가 없습니다.
- 표준 프로젝트에 일부 기본 라이브러리를 통합합니다 (Push Notifications, Asset Manager 등).
- ExpoKit으로 추출하고 일부 Expo 기능을 계속 사용하여 네이티브 코드를 통합 할 수 있습니다.
- Expo는 .apk 및 .ipa 파일을 빌드 할 수 있습니다 (Expo로 가능한 상점에 배포)
단점 :
- 네이티브 모듈을 추가 할 수 없습니다 (아마 일부는 게임 체인저)
- Objective-C / Java에서 기본 코드를 사용하는 라이브러리를 사용할 수 없습니다
- 표준 Hello World 앱의 크기는 약 25MB입니다 (통합 라이브러리로 인해).
- 사용하려는 경우 : FaceDetector, ARKit o 지불 당신은 그것을 ExpoKit으로 꺼내야합니다
- ExpoKit으로 추출하면 Expo의 기능이 상충됩니다 (예 : QR 코드를 통해 공유 할 수 없음)
- ExpoKit으로 배출 할 때 해당 시점에 ExpoKit에서 지원하는 반응 기본 버전으로 제한됩니다
- ExpoKit (기본 모듈 사용)에서의 디버깅은 두 언어와 다른 라이브러리가 혼합되어 있기 때문에 훨씬 더 복잡합니다 (공식 Expo는 더 이상 지원하지 않음)
가장 중요한 포인트를 요약 할 수 있기를 바랍니다. 추가 포인트를 자유롭게 추가하십시오.
출처 : https://code.tutsplus.com/tutorials/detaching-expo-apps-to-expokit-concepts--cms-30661 https://github.com/react-community/create-react-native-app/ issues / 516 # issuecomment-373629114 https://docs.expo.io/versions/latest/guides/detach.html (일반적인 공식 문서)
공식 엑스포 문서에 설명되어 있습니다.
What is the difference between Expo and React Native?
Expo is kind of like Rails for React Native. Lots of things are set up for you, so it’s quicker to get started and on the right path.
With Expo, you don’t need Xcode or Android Studio. You just write JavaScript using whatever text editor you are comfortable with (Atom, vim, emacs, Sublime, VS Code, whatever you like). You can run XDE (our desktop software) on Mac, Windows, and Linux.
Here are some of the things Expo gives you out of the box that work right away:
Support for iOS and Android
You can use apps written in Expo on both iOS and Android right out of the box. You don’t need to go through a separate build process for each one. Just open any Expo app in the Expo Client app from the App Store on either iOS or Android (or in a simulator or emulator on your computer).
Push Notifications
Push notifications work right out of the box across both iOS and Android, using a single, unified API. You don’t have to set up APNS and GCM/FCM or configure ZeroPush or anything like that. We think we’ve made this as easy as it can be right now.
Facebook Login
This can take a long time to get set up properly yourself, but you should be able to get it working in 10 minutes or less on Expo.
Instant Updating
All Expo apps can be updated in seconds by just clicking Publish in XDE. You don’t have to set anything up; it just works this way. If you aren’t using Expo, you’d either use Microsoft Code Push or roll your own solution for this problem
Asset Management
Images, videos, fonts, etc. are all distributed dynamically over the Internet with Expo. This means they work with instant updating and can be changed on the fly. The asset management system built-in to Expo takes care of uploading all the assets in your repo to a CDN so they’ll load quickly for anyone.
Without Expo, the normal thing to do is to bundle your assets into your app which means you can’t change them. Or you’d have to manage putting your assets on a CDN or similar yourself.
Easier Updating To New React Native Releases
We do new releases of Expo every few weeks. You can stay on an old version of React Native if you like, or upgrade to a new one, without worrying about rebuilding your app binary. You can worry about upgrading the JavaScript on your own time.
But no native modules…
The most limiting thing about Expo is that you can’t add in your own native modules without detaching and using ExpoKit.
The answer of Brent Vatne is fine but I'd like to add some details.
Expo expands the API surface of React Native
React Native does not give you all the JS APIs you need out of the box, but only most primitive features. React Native developers are expected to use Android Studio/XCode to link additional native libraries. Expo aims to enhance RN and provide all the JS API you need for the most common needs. It is basically a set of well-defined quality native libs already packaged for you in a single lib: ExpoKit. Sometimes these libraries are actually already existing in RN world, and integrated into ExpoKit.
It is also important to notice that the Expo team can't include every lib out there into ExpoKit (which may create some frustration) because the hello world app size would grow, as it would ship a lot of API's that wouldn't be used in most apps.
Expo provides over-the-air JS updates
Like other systems (CodePush...), Expo provides a system to update your app over the air. This means you upload your JS bundle on a CDN and the mobile apps will automatically download and use the new JS on next startup (without requesting a publication/review from the stores).
Expo provides a CLI tool to upload/manage the JS bundles on their CDN. For development you can also choose to become the CDN and host the JS bundle on localhost. And XDE is just a visual wrapper on the CLI.
Expo provides a generic client
The Expo client is a generic client that permits to load any app that is compatible with Expo. All the Expo apps do share the exact same native runtime (RN + ExpoKit), the only difference is the JS that we give them. The Expo apps you publish to the app stores have your JS bundle url hardcoded in it. The Expo client is build in a specific way so that you can choose from which url to load the JS, by scanning a QRCode or providing an url.
Note that this client can also load JS bundles from localhost, and make your development experience easier: no need for XCode or Android Studio, and it gets much faster to get your first Hello World running on the phone (from hours to minutes). You can actually develop on an iPhone without a Mac and the setup takes 2 minutes.
Actually as the Expo SDK can be upgraded, the Expo client includes a compatibility layer so that it is able to run the last 5 SDK versions.
Expo provides a build service
As all the Expo apps share the same native code, Expo is able to easily build these apps for you. They have created a cloud build service.
The major thing that differenciate 2 apps built by Expo is just the hardcoded url to which the app is supposed to download the JS bundle to run.
Expo does some other things for you, like providing a declarative way to setup app icons, orientations, permissions, api keys, helping you setup push notifications, provisioning profiles... many settings have to be hardcoded at build time in the app and can't be changed over the air.
Expo is to React Native what Phonegap is to Cordova
React Native is similar Cordova. It is not the same view technology (native vs webview) but both allow you to control native features from javascript, and both offer a plugin system so that developers can easily add new JS/native bindings.
PhoneGap is similar to Expo. They both try to enrich the raw API of the underlying platform they are built on with a predefined set of additional native plugins. PhoneGap also offers a build service and has a generic client that work as long as you use the approved plugins.
Conclusion
As you can see, Expo is a set of tools. At the end it permits to easily develop, share and publish to the stores your mobile projects. It is quite similar to the PhoneGap experience (but a lot better and less confusing).
I will definitively recommend Expo for any new React Native greenfield project, except these 2 cases:
- You already know you need API's that are not available in Expo and won't be anytime soon
- You care a lot about your app size (HelloWorld is > 25mb due to large size of ExpoKit, but after that it does not increase much as it is just JS)
EXPO CLI
pros:-
1. No need to install Android studio and Xcode for start building mobile app.
2. No requirement of high configuration machine for development.
3. Mobile ui easily check on both devices android and iphone using barcode scanning.and some time you can check on online iphone and android simulators.
4. fast development.
Cons:-
1. Native dependency can not add on expo because expo project don't have ios and android folder so here expo is bounded.
2. Making apk and ipa are to difficult using expo.
3. Size of the apk/ipa is huge
React Native Cli
Pros:-
1. Easily add native dependency for android and ios because this project structure have ios and android folder.
2. Apk and ipa build making is easy rather than expo.
Note":- React Native cli is right approach to started work on react native framework.
Cons:-
1. High configuration machine is require.
2. Adding dependency some time more difficult but good.
3. Required basic knowledge of android folder structure and ios folder structure but from this learn more things.
You can prefer any approach according you requirements.
The answers about advantages and disadvantages of expo and react-native-cli are complete. I want to mention another point as my personal experience. Expo contains many modules by default in the project and it makes easier to work with it. But it has a big problem on production phase because the built android
and ios
versions have such a great size. For Example if you have a single page with a 'Hello World'
the apk
file size would be about 19 MB
. Having a same project in react-native-cli will result in an app with the size of 6 MB
.
So personally I do not recommend using expo if you want to develop a commercial app.
I would make a note here that Expo is using an older version of react 16.5 Which would prohibit you from using the new hooks feature. If you decide to go with Expo be mindful to watch your version controls. Older versions of say react-navigation will need to be used with the 16.5 version if you are getting weird errors.
expo is a toolchain built around React Native to help you quickly start an app. It provides a set of tools that simplify the development and testing of React Native app and interface and services that are usually available in third-party native React Native components. With Expo you can find all of them in Expo SDK.
참고URL : https://stackoverflow.com/questions/39170622/what-is-the-difference-between-expo-and-react-native
'Programing' 카테고리의 다른 글
ZXing 라이브러리를 내 Android 애플리케이션에 직접 통합 (0) | 2020.06.22 |
---|---|
SSL 핸드 셰이크에서 'DH 키 쌍을 생성 할 수 없습니다'예외가 발생하는 이유는 무엇입니까? (0) | 2020.06.22 |
WPF / MVVM Light Toolkit으로 창 닫기 이벤트 처리 (0) | 2020.06.22 |
모든 프로그래머가 메모리에 대해 알아야 할 사항 (0) | 2020.06.22 |
Java 8에서 스트림을 캐스트 할 수 있습니까? (0) | 2020.06.22 |