Git Product home page Git Product logo

meishijie / hippy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tencent/hippy

0.0 1.0 0.0 386.25 MB

Hippy is designed for Web developer to easily build cross-platform and high-performance awesome apps. ๐Ÿ‘

Home Page: https://hippyjs.org

License: Apache License 2.0

JavaScript 7.48% Java 29.95% CMake 0.11% C++ 36.25% C 1.24% Objective-C 14.38% Objective-C++ 6.37% Shell 0.05% TypeScript 4.12% Ruby 0.03% Dockerfile 0.02%

hippy's Introduction

Hippy Cross Platform Framework

Hippy Group license PRs Welcome node Actions Status Codecov GitHub release (latest SemVer)

English | ็ฎ€ไฝ“ไธญๆ–‡ | Homepage

๐Ÿ’ก Introduction

Hippy is a cross-platform development framework, aiming to help developers write once, run on three platforms(iOS, Android and Web). Hippy is quite friendly to Web developers, especially who are familiar with React or Vue. With Hippy, developers are able to create the cross platform app easily.

Hippy is now applied in 27+ Tencent apps such as Mobile QQ, Mobile QQ Browser, Tencent Video App, QQ Music App, Tencent News, reaching hundreds of millions of ordinary users.

๐Ÿ’ฏ Advantages

  • Designed for Web developers, officially support Web frameworks like React and Vue.
  • 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.

๐Ÿ”จ Getting started

Preparing environment

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:

homebrew is recommended to install the dependencies.

For Windows developers:

Windows can't run the iOS development environment so far.

Build the iOS simulator with js demo

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.

  1. Run npm run init at root directory.

    This command is combined with npm install && lerna bootstrap && npm run build.

    npm install: Install the project build scripts dependencies.

    lerna bootstrap: Install dependencies of each npm package.๏ผˆHippy uses Lerna to manage multi js packages, if lerna command is not found, execute npm install lerna -g first.๏ผ‰

    npm run build: Build each front-end sdk package.

  2. Choose a demo to build with npm run buildexample -- [hippy-react-demo|hippy-vue-demo] at root directory.

  3. Start the Xcode and build the iOS app with open examples/ios-demo/HippyDemo.xcodeproj.

If Step 2 throw error, you can cd to examples hippy-react-demo or hippy-vue-demo, and run npm install --legacy-peer-deps to install demo dependencies first.

More details for iOS SDK integration.

Build the Android app with js demo

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.

  1. Run npm run init at root directory.

    This command is combined with npm install && lerna bootstrap && npm run build.

    npm install: Install the project build scripts dependencies.

    lerna bootstrap: Install dependencies of each npm package.๏ผˆHippy uses Lerna to manage multi js packages, if lerna command is not found, execute npm install lerna -g first.๏ผ‰

    npm run build: Build each front-end sdk package.

  2. Choose a demo to build with npm run buildexample -- [hippy-react-demo|hippy-vue-demo] at root directory.

  3. Open the examples/android-demo with Android Studio.

  4. Connect Android phone with USB cable and make sure USB debugging mode is enabled(Run adb devices on the computer terminal to check cellphone connection status).

  5. Open the project with Android Studio, run and install the apk.

If Step 2 throw error, you can cd to examples hippy-react-demo or hippy-vue-demo, and run npm install --legacy-peer-deps to 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.

Debug the js demo

  1. Follow Build the iOS simulator with js demo or Build the Android app with js demo first to build the App.
  2. Run npm run init:example -- [hippy-react-demo|hippy-vue-demo] at root directory.
  3. Run npm run debugexample -- [hippy-react-demo|hippy-vue-demo] dev at root directory.
  4. Run npm run debugexample -- [hippy-react-demo|hippy-vue-demo] debug at root directory.

Or you can cd to examples hippy-react-demo or hippy-vue-demo to run npm run hippy:dev and npm run hippy:debug instead. (npm run hippy:local-debug and npm run hippy:local-dev will link to source code in packages).

On example debug mode, npm packages such as @hippy/react, @hippy/vue 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 call npm run build at root directory again.

More details for debugging can be read in Hippy Debug Document.

Build the js production demo

  1. Follow Build the iOS simulator with js demo or Build the Android app with js demo first to build the App.
  2. cd to examples hippy-react-demo or hippy-vue-demo.
  3. Run npm install to install demo js dependencies.
  4. Run npm run hippy:vendor and npm run hippy:build in sequence to build the production vendor.[android|ios].js and index.[android|ios].js.

Hippy demo uses DllPlugin to split the common chunk and app chunk.

๐Ÿ“ Documentation

To check out hippy examples and visit hippyjs.org.

๐Ÿ“… Changelog

Detailed changes for each release version are documented in the project release notes.

๐Ÿงฑ Project structure

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.
โ”‚ย ย  โ”œโ”€โ”€ ios-demo                      # iOS native demo code.
โ”‚ย ย  โ””โ”€โ”€ android-demo                  # Android native demo code.
โ”œโ”€โ”€ packages                          # npm packages.
โ”‚ย ย  โ”œโ”€โ”€ hippy-debug-server            # Debug the Hippy with native.
โ”‚ย ย  โ”œโ”€โ”€ hippy-react                   # React binding for Hippy.
โ”‚ย ย  โ”œโ”€โ”€ hippy-react-web               # Web adapter for hippy-react.
โ”‚ย ย  โ”œโ”€โ”€ hippy-vue                     # Vue 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.
โ”‚ย ย  โ””โ”€โ”€ types                         # Global type definition.
โ”œโ”€โ”€ ios
โ”‚ย ย  โ””โ”€โ”€ sdk                           # iOS SDK
โ”œโ”€โ”€ android
โ”‚ย ย  โ”œโ”€โ”€ support_ui                    # Android native components.
โ”‚ย ย  โ””โ”€โ”€ 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.

๐Ÿค Contribution

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.

โค๏ธ Stargazers over time

Stargazers over time

๐Ÿ“„ License

Hippy is Apache-2.0 licensed.

๐Ÿ”— Links

Hippy Eco-System

Taitank Layout Engine

hippy's People

Watchers

James Cloos avatar

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.