Hippy is a cross-platform development framework, that aims to help developers write once, and run on multiple platforms(iOS, Android, Web, and so on). Hippy is quite friendly to Web developers, especially those who are familiar with React or Vue. With Hippy, developers can create the cross-platform app easily.
Hippy is now applied in Tencent major apps such as Mobile QQ, Mobile QQ Browser, Tencent Video App, QQ Music App, and Tencent News, reaching hundreds of millions of ordinary users.
- Designed for Web developers, officially support Web frameworks like
ReactandVue. - Same APIs for different platforms.
- Excellent performance with JS engine binding communication.
- Build-in recyclable component with better performance.
- Smoothly and gracefully migrate to Web browser.
- Fully supported Flex Layout engine.
Make sure you have git and npm installed locally.
Run git clone https://github.com/Tencent/Hippy.git and npm install at project root directory.
The Hippy repository applies git-lfs to manage so,gz,otf files, make sure you have installed git-lfs first.
For macOS developers:
- Xcode with iOS sdk: build the iOS app.
- Android Studio with NDK: build the android app.
- Node.JS: run the build scripts.
homebrew is recommended to install the dependencies.
For Windows developers:
- Android Studio with NDK: build the android app.
- Node.JS: run the build scripts.
Windows can't run the iOS development environment so far.
For iOS, we recommend to use iOS simulator when first try. However, you can change the Xcode configuration to install the app to iPhone if you are an iOS expert.
-
Run
npm run initat root directory.This command is combined with
npm install && npx lerna bootstrap && npm run build.npm install: Install the project build scripts dependencies.npx lerna bootstrap: Install dependencies of each npm package.οΌHippy uses Lerna to manage multi js packages, iflernacommand is not found, executenpm install lerna -gfirst.οΌnpm run build: Build each front-end sdk package. -
Choose a demo to build with
npm run buildexample [hippy-react-demo|hippy-vue-demo|hippy-vue-next-demo]at root directory. -
Start the Xcode and build the iOS app with open
Hippy.xcworkspaceat root directory.
If
Step 2throw error, you cancdtoexampleshippy-react-demo or hippy-vue-demo or hippy-vue-next-demo, and runnpm install --legacy-peer-depsto install demo dependencies first.More details for iOS SDK integration.
For Android, we recommend using the real cellphone for better develop experience, because Hippy is using X5 JS engine which can't support x86 simulator, as well as ARM simulator has a low performance.
Before build the android app, please make sure the SDK and NDK is installed, And DO NOT update the build toolchain.
-
Run
npm run initat root directory.This command is combined with
npm install && npx lerna bootstrap && npm run build.npm install: Install the project build scripts dependencies.npx lerna bootstrap: Install dependencies of each npm package.οΌHippy uses Lerna to manage multi js packages, iflernacommand is not found, executenpm install lerna -gfirst.οΌnpm run build: Build each front-end sdk package. -
Choose a demo to build with
npm run buildexample [hippy-react-demo|hippy-vue-demo|hippy-vue-next-demo]at root directory. -
Open
Android Projectat root directory with Android Studio. -
Connect Android phone with USB cable and make sure USB debugging mode is enabled(Run
adb deviceson the computer terminal to check cellphone connection status). -
Open the project with Android Studio, run and install the apk.
If
Step 2throw error, you cancdtoexampleshippy-react-demo or hippy-vue-demo or hippy-vue-next-demo, and runnpm install --legacy-peer-depsto install demo dependencies first.If you encounter the issue of
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android, here is the solution.More details for Android SDK integration.
- Follow Build the iOS simulator with js demo or Build the Android app with js demo first to build the App.
- Run
npm run init:example [hippy-react-demo|hippy-vue-demo|hippy-vue-next-demo]at root directory. - Run
npm run debugexample [hippy-react-demo|hippy-vue-demo|hippy-vue-next-demo] devat root directory.
Or you can
cdtoexamples/hippy-react-demoorexamples/hippy-vue-demoorexamples/hippy-vue-next-demodirectory to runnpm run hippy:devinstead.On example debug mode, npm packages such as @hippy/react, @hippy/vue, @hippy/vue-next are linked to
packages>[different package]>dist(not node_modules), so if you have changed js package source code and want to make it take effect in target example, please callnpm run buildat root directory again.More details for debugging can be read in Hippy Debug Document.
- Follow Build the iOS simulator with js demo or Build the Android app with js demo first to build the App.
cdto exampleshippy-react-demoorhippy-vue-demoorhippy-vue-next-demo.- Run
npm installto install demo js dependencies. - Run
npm run hippy:vendorandnpm run hippy:buildin sequence to build the productionvendor.[android|ios].jsandindex.[android|ios].js.
Hippy demo uses DllPlugin to split the common chunk and app chunk.
To check out hippy examples and visit hippyjs.org.
Detailed changes for each release version are documented in the project release notes.
Hippy
βββ examples # Demo code for frontend or native developer.
βΒ Β βββ hippy-react-demo # hippy-react js demo code.
βΒ Β βββ hippy-vue-demo # hippy-vue js demo code.
βΒ Β βββ hippy-vue-next-demo # hippy-vue-next js demo code.
βΒ Β βββ ios-demo # iOS native demo code.
βΒ Β βββ android-demo # Android native demo code.
βββ packages # npm packages.
βΒ Β βββ hippy-react # React binding for Hippy.
βΒ Β βββ hippy-react-web # Web adapter for hippy-react.
βΒ Β βββ hippy-vue-next-style-parser # style parser for Hippy vue-next.
βΒ Β βββ hippy-vue # Vue binding for Hippy.
βΒ Β βββ hippy-vue-next # Vue-next binding for Hippy.
βΒ Β βββ hippy-vue-css-loader # Webpack loader for convert CSS text to JS AST.
βΒ Β βββ hippy-vue-loader # Forked from vue-loader to do some hippy customization.
βΒ Β βββ hippy-vue-native-components # Native components extensions for hippy-vue.
βΒ Β βββ hippy-vue-router # Vue router for hippy-vue.
βββ ios
βΒ Β βββ sdk # iOS SDK
βββ android
βΒ Β βββ sdk # Android SDK.
βββ core # JS modules implemented by C++, binding to JS engine.
βββ docker # Native release docker image and build scripts.
βββ layout # Hippy layout engine.
βββ static # Global static resources stored directory.
βββ scripts # Project build script.
Developers are welcome to contribute to Tencent's open source, and we will also give them incentives to acknowledge and thank them. Here we provide an official description of Tencent's open source contribution. Specific contribution rules for each project are formulated by the project team. Developers can choose the appropriate project and participate according to the corresponding rules. The Tencent Project Management Committee will report regularly to qualified contributors and awards will be issued by the official contact. Before making a pull request or issue to Hippy, please make sure to read Contributing Guide.
All the people who already contributed to Hippy can be seen in Contributors and Authors File.
Hippy is Apache-2.0 licensed.