Skip to content

Commit

Permalink
refactor(js): change framework dir name to driver
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj authored and siguangli committed May 23, 2022
1 parent b4bdb9a commit dfcaed8
Show file tree
Hide file tree
Showing 39 changed files with 156 additions and 156 deletions.
8 changes: 4 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages/hippy-vue/types
packages/hippy-debug-server/webpack-dev-server/client
packages/hippy-debug-server/webpack-dev-server/lib
packages/hippy-vue-loader/lib
framework/js/packages/hippy-vue/types
framework/js/packages/hippy-debug-server/webpack-dev-server/client
framework/js/packages/hippy-debug-server/webpack-dev-server/lib
framework/js/packages/hippy-vue-loader/lib
driver/js/packages/hippy-vue/types
driver/js/packages/hippy-debug-server/webpack-dev-server/client
driver/js/packages/hippy-debug-server/webpack-dev-server/lib
driver/js/packages/hippy-vue-loader/lib
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ module.exports = {
['core', resolveVue('core')],
['shared', resolveVue('shared')],
['sfc', resolveVue('sfc')],
['he', path.resolve(__dirname, './framework/js/packages/hippy-vue/src/util/entity-decoder')],
['he', path.resolve(__dirname, './driver/js/packages/hippy-vue/src/util/entity-decoder')],
],
},
},
Expand Down
23 changes: 11 additions & 12 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,20 @@

/dom/ @churchill-zhang @ilikethese

/framework/js/core/ @churchill-zhang @zoomchan-cxj
/framework/js/core/js/ @zoomchan-cxj
/driver/js/core/ @churchill-zhang @zoomchan-cxj
/driver/js/core/js/ @zoomchan-cxj

/framework/js/android/ @siguangli @churchill-zhang
/framework/js/ios/ @ozonelmy @churchill-zhang
/ios/ @ozonelmy @churchill-zhang
/driver/js/android/ @siguangli @churchill-zhang
/driver/js/ios/ @ozonelmy @churchill-zhang

/framework/js/examples/android-demo/ @siguangli
/framework/js/examples/android-demo/res/ @zoomchan-cxj
/framework/js/examples/ios-demo/ @ozonelmy
/framework/js/examples/ios-demo/res/ @zoomchan-cxj
/framework/js/examples/hippy-react-demo/ @zoomchan-cxj
/framework/js/examples/hippy-vue-demo/ @zoomchan-cxj
/driver/js/examples/android-demo/ @siguangli
/driver/js/examples/android-demo/res/ @zoomchan-cxj
/driver/js/examples/ios-demo/ @ozonelmy
/driver/js/examples/ios-demo/res/ @zoomchan-cxj
/driver/js/examples/hippy-react-demo/ @zoomchan-cxj
/driver/js/examples/hippy-vue-demo/ @zoomchan-cxj

/framework/js/packages/ @zoomchan-cxj
/driver/js/packages/ @zoomchan-cxj

/gradle/ @siguangli @medns
/layout/ @ilikethese
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: '[front-end] check js code'
on:
pull_request:
paths:
- 'framework/js/packages/**'
- 'framework/js/examples/hippy-*-demo/**'
- 'framework/js/core/js/**/*.js'
- 'driver/js/packages/**'
- 'driver/js/examples/hippy-*-demo/**'
- 'driver/js/core/js/**/*.js'
- 'package*.json'
- 'scripts/**/*.js'
branches:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: '[iOS] build iOS native example'
on:
pull_request:
paths:
- 'framework/js/ios/**'
- 'driver/js/ios/**'
- 'ios/**'
branches:
# Pull request events to main branch
Expand All @@ -27,4 +27,4 @@ jobs:
# https://github.com/actions/virtual-environments/issues/4180
# Xcode_13 will be selected on October, 18, so we need to set to xcode13 manually before that day.
sudo xcode-select --switch '/Applications/Xcode_13.0.app/'
pushd framework/js/examples/ios-demo && xcodebuild build -destination 'name=iPhone 11' -scheme 'HippyDemo' && popd
pushd driver/js/examples/ios-demo && xcodebuild build -destination 'name=iPhone 11' -scheme 'HippyDemo' && popd
4 changes: 2 additions & 2 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"include": [
"framework/js/packages/**/*.js"
"driver/js/packages/**/*.js"
],
"exclude": [
"framework/js/packages/**/__tests__/*.test.js"
"driver/js/packages/**/__tests__/*.test.js"
],
"reporter": [
"lcov",
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ For iOS, we recommend to use iOS simulator when first try. However, you can chan
> `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 framework/js/examples/ios-demo/HippyDemo.xcodeproj`.
3. Start the Xcode and build the iOS app with `open driver/js/examples/ios-demo/HippyDemo.xcodeproj`.

> If `Step 2` throw error, you can `cd` to `framework/js/examples` hippy-react-demo or hippy-vue-demo, and run `npm install --legacy-peer-deps` to install demo dependencies first.
> If `Step 2` throw error, you can `cd` to `driver/js/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](https://hippyjs.org/#/ios/integration?id=ios-%e9%9b%86%e6%88%90).
Expand All @@ -82,11 +82,11 @@ Before build the android app, please make sure the SDK and NDK is installed, And
> `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 `framework/js/examples/android-demo` with Android Studio.
3. Open the `driver/js/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 `framework/js/examples` hippy-react-demo or hippy-vue-demo, and run `npm install --legacy-peer-deps` to install demo dependencies first.
> If `Step 2` throw error, you can `cd` to `driver/js/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](https://github.com/google/filament/issues/15#issuecomment-415423557).
>
Expand All @@ -99,9 +99,9 @@ Before build the android app, please make sure the SDK and NDK is installed, And
3. Run `npm run debugexample [hippy-react-demo|hippy-vue-demo] debug` at root directory.
4. Run `npm run debugexample [hippy-react-demo|hippy-vue-demo] dev` at root directory.

> Or you can `cd` to `framework/js/examples/hippy-react-demo` or `framework/js/examples/hippy-vue-demo` directory to run `npm run hippy:debug` and `npm run hippy:dev` instead.
> Or you can `cd` to `driver/js/examples/hippy-react-demo` or `driver/js/examples/hippy-vue-demo` directory to run `npm run hippy:debug` and `npm run hippy:dev` instead.
>
> On example debug mode, npm packages such as @hippy/react, @hippy/vue are linked to `framework/js/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.
> On example debug mode, npm packages such as @hippy/react, @hippy/vue are linked to `driver/js/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](https://hippyjs.org/#/guide/debug).
Expand Down
10 changes: 5 additions & 5 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ Windows 用户者需要以下软件:
> `npm run build`:编译每一个 JS SDK 包。
2. 选择一个前端范例项目来进行编译,在项目根目录运行 `npm run buildexample [hippy-react-demo|hippy-vue-demo]`
3. 启动 Xcode 并且开始编译终端 App:`open framework/js/examples/ios-demo/HippyDemo.xcodeproj`
3. 启动 Xcode 并且开始编译终端 App:`open driver/js/examples/ios-demo/HippyDemo.xcodeproj`

> 如果步骤2出现错误,可以先 `cd``framework/js/examples` hippy-react-demo 或者 hippy-vue-demo 目录下,执行 `npm install --legacy-peer-deps`,提前将 demo 的 NPM 包依赖先安装好。
> 如果步骤2出现错误,可以先 `cd``driver/js/examples` hippy-react-demo 或者 hippy-vue-demo 目录下,执行 `npm install --legacy-peer-deps`,提前将 demo 的 NPM 包依赖先安装好。
>
> 更多信息请参考 [iOS SDK 集成](https://hippyjs.org/#/ios/integration?id=ios-%e9%9b%86%e6%88%90)
Expand All @@ -81,7 +81,7 @@ Windows 用户者需要以下软件:
>
> `npm run build`:编译每一个 JS SDK 包。
2. 选择一个前端范例项目来进行编译,在项目根目录运行 `npm run buildexample [hippy-react-demo|hippy-vue-demo]`
3. 用 Android Studio 来打开终端范例工程 `framework/js/examples`
3. 用 Android Studio 来打开终端范例工程 `driver/js/examples`
4. 用 USB 数据线插上你的 Android 手机,需要确认手机已经打开 USB 调试模式(可通过在电脑 Terminal 执行 `adb devices` 判断手机是否已经连上了电脑)。
5. 运行工程,并安装 APK。

Expand All @@ -98,9 +98,9 @@ Windows 用户者需要以下软件:
3. 根目录执行 `npm run debugexample [hippy-react-demo|hippy-vue-demo] debug`
4. 根目录执行 `npm run debugexample [hippy-react-demo|hippy-vue-demo] dev`

> 你也可以 `cd``framework/js/examples/hippy-react-demo` 或者 `framework/js/examples//hippy-vue-demo` 目录去分别执行 `npm run hippy:debug``npm run hippy:dev`
> 你也可以 `cd``driver/js/examples/hippy-react-demo` 或者 `driver/js/examples//hippy-vue-demo` 目录去分别执行 `npm run hippy:debug``npm run hippy:dev`
>
> 在 example 调试模式下,@hippy/react@hippy/vue 等 npm 模块会直接链接到 `framework/js/packages` > `[different package]` > `dist` 目录下面的 js 文件(非 node_modules),所以如果你修改了 packages 下的 JS 源代码并且想让其在 example 中生效,请重新在根目录执行 `npm run build`
> 在 example 调试模式下,@hippy/react@hippy/vue 等 npm 模块会直接链接到 `driver/js/packages` > `[different package]` > `dist` 目录下面的 js 文件(非 node_modules),所以如果你修改了 packages 下的 JS 源代码并且想让其在 example 中生效,请重新在根目录执行 `npm run build`
>
> 更多关于调试的说明请浏览 [Hippy Debug Document](https://hippyjs.org/#/guide/debug)
Expand Down
2 changes: 1 addition & 1 deletion ava.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
extensions: false,
compileEnhancements: false,
files: [
'framework/js/packages/**/__tests__/*.test.js',
'driver/js/packages/**/__tests__/*.test.js',
],
require: [
'esm', // Use ES modules in NodeJS.
Expand Down
8 changes: 4 additions & 4 deletions docs/android/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

# Demo 体验

若想快速体验,可以直接基于我们的 [Android Demo](https://github.com/Tencent/Hippy/tree/master/framework/js/examples/android-demo) 来开发
若想快速体验,可以直接基于我们的 [Android Demo](https://github.com/Tencent/Hippy/tree/master/driver/js/examples/android-demo) 来开发

# 快速接入

1. 创建一个 Android 工程

2. 本地集成

- [Demo](//github.com/Tencent/Hippy/tree/master/framework/js/examples/android-demo) 工程运行 Gradle Task `other => assembleRelease` 或者 `other => assembleDebug` 后会在 `android\sdk\build\outputs\aar` 目录下生成 `release` 或者 `debug` 模式的
- [Demo](//github.com/Tencent/Hippy/tree/master/driver/js/examples/android-demo) 工程运行 Gradle Task `other => assembleRelease` 或者 `other => assembleDebug` 后会在 `android\sdk\build\outputs\aar` 目录下生成 `release` 或者 `debug` 模式的
`android-sdk.aar`,将 `android-sdk.aar` 拷贝到你项目的 `libs` 目录下。

!> 通过 `assembleRelease` task 生成的 AAR 默认不携带 `inspector` 模块,不能在前端通过 Devtools 对代码进行调试,若需要集成 `inspector`,请执行 `assembleDebug` task
Expand All @@ -47,6 +47,6 @@
api 'com.android.support:support-v4:28.0.0'
```

4. 继承 `HippyImageLoader` 并实现自己的图片加载器,具体可以参考 [Demo](//github.com/Tencent/Hippy/tree/master/framework/js/examples/android-demo) 工程中 `MyImageLoader` 实现。
4. 继承 `HippyImageLoader` 并实现自己的图片加载器,具体可以参考 [Demo](//github.com/Tencent/Hippy/tree/master/driver/js/examples/android-demo) 工程中 `MyImageLoader` 实现。

5. 在宿主 APP 工程中增加引擎初始化与 `hippyRootView` 挂载逻辑,具体可以参考 [Demo](//github.com/Tencent/Hippy/tree/master/framework/js/examples/android-demo) 工程中 MyActivity 实现
5. 在宿主 APP 工程中增加引擎初始化与 `hippyRootView` 挂载逻辑,具体可以参考 [Demo](//github.com/Tencent/Hippy/tree/master/driver/js/examples/android-demo) 工程中 MyActivity 实现
2 changes: 1 addition & 1 deletion docs/core/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hippy Core 架构

Hippy 开发的时候,前端 JS 经常需要访问一些双端(Android 和 iOS)通用能力,Hippy 推荐使用 `internalBinding` 来实现底层能力扩展(我们将这项能力称为 [Core 架构](//github.com/Tencent/Hippy/tree/master/framework/js/core)),它和 Node.js 的 internalBinding 一样,使用 C++ 进行开发,直接共享 JS 和 C++ 运行环境和数据,提供了非常高的 JS 和终端通信性能。
Hippy 开发的时候,前端 JS 经常需要访问一些双端(Android 和 iOS)通用能力,Hippy 推荐使用 `internalBinding` 来实现底层能力扩展(我们将这项能力称为 [Core 架构](//github.com/Tencent/Hippy/tree/master/driver/js/core)),它和 Node.js 的 internalBinding 一样,使用 C++ 进行开发,直接共享 JS 和 C++ 运行环境和数据,提供了非常高的 JS 和终端通信性能。

它的原理是在 JS 环境中直接插入函数、类等方式,JS 使用这些函数或方法,可以直接访问 C++ 代码。

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/custom-font.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

前端使用自定义字体非常简单,和浏览器一样,使用 [font-family](https://www.w3schools.com/cssref/pr_font_font-family.asp) 样式即可。

有两个范例:[hippy-react-demo](https://github.com/Tencent/Hippy/blob/master/framework/js/examples/hippy-react-demo/src/components/Text/index.jsx#L49)[hippy-vue-demo](https://github.com/Tencent/Hippy/blob/master/framework/js/examples/hippy-vue-demo/src/components/demos/demo-p.vue#L41)
有两个范例:[hippy-react-demo](https://github.com/Tencent/Hippy/blob/master/driver/js/examples/hippy-react-demo/src/components/Text/index.jsx#L49)[hippy-vue-demo](https://github.com/Tencent/Hippy/blob/master/driver/js/examples/hippy-vue-demo/src/components/demos/demo-p.vue#L41)

但是如果要使用操作系统自带以外的字体,需要单独整合一下,继续阅读下面内容。

Expand Down Expand Up @@ -63,4 +63,4 @@ Android 只需要在静态资源 `assets` 目录中建立 `fonts` 目录,然

需要注意的是,字体文件名需要和 FontFamily 一致,因为 Android 虽然也可以做字体文件名映射,但是字体和文件名一致无疑是最简单的办法。

> 官方 demo 的字体放在 [res/fonts](https://github.com/Tencent/Hippy/tree/master/framework/js/examples/android-demo/res) 目录下,是因为编译脚本[`res` 目录下的文件直接拷贝到 `assets` 目录](https://github.com/Tencent/Hippy/blob/master/framework/js/examples/android-demo/build.gradle#L35)下了,所以 `res/assets` 就变成 `assets/assets` 目录,为了让字体目录正确拷贝进 `assets` 静态资源目录,只能让它放在 `res` 下。
> 官方 demo 的字体放在 [res/fonts](https://github.com/Tencent/Hippy/tree/master/driver/js/examples/android-demo/res) 目录下,是因为编译脚本[`res` 目录下的文件直接拷贝到 `assets` 目录](https://github.com/Tencent/Hippy/blob/master/driver/js/examples/android-demo/build.gradle#L35)下了,所以 `res/assets` 就变成 `assets/assets` 目录,为了让字体目录正确拷贝进 `assets` 静态资源目录,只能让它放在 `res` 下。
6 changes: 3 additions & 3 deletions docs/guide/dynamic-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Hippy 2.2 版本之前只支持加载单个 js bundle 文件。随着业务越

## 范例

[[React 范例]](//github.com/Tencent/Hippy/blob/master/framework/js/examples/hippy-react-demo/src/externals/DyanmicImport/index.jsx)
[[React 范例]](//github.com/Tencent/Hippy/blob/master/driver/js/examples/hippy-react-demo/src/externals/DyanmicImport/index.jsx)

[[Vue 范例]](//github.com/Tencent/Hippy/blob/master/framework/js/examples/hippy-vue-demo/src/components/demos/demo-dynamicimport.vue)
[[Vue 范例]](//github.com/Tencent/Hippy/blob/master/driver/js/examples/hippy-vue-demo/src/components/demos/demo-dynamicimport.vue)

## 使用方法

Expand All @@ -27,7 +27,7 @@ Hippy 2.2 版本之前只支持加载单个 js bundle 文件。随着业务越

### 使用

[webpack 打包脚本](https://github.com/Tencent/Hippy/tree/master/framework/js/examples/hippy-vue-demo/scripts) 中引入插件
[webpack 打包脚本](https://github.com/Tencent/Hippy/tree/master/driver/js/examples/hippy-vue-demo/scripts) 中引入插件

```javascript
const HippyDynamicImportPlugin = require('@hippy/hippy-dynamic-import-plugin');
Expand Down
Loading

0 comments on commit dfcaed8

Please sign in to comment.