Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pub/framework/voltron/dio-5.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
open-hippy authored Sep 4, 2023
2 parents 6a3c27e + be822e3 commit 0e00cfc
Show file tree
Hide file tree
Showing 249 changed files with 8,501 additions and 3,301 deletions.
42 changes: 21 additions & 21 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ CMakeLists.txt @ilikethese @etkmao
/driver/vl/ @ilikethese @etkmao

# framework: android
/framework/android/ @siguangli
/framework/android/ @siguangli @iPel
/framework/android/**/src/main/cpp/ @etkmao @ilikethese

# framework: ios
/framework/ios/ @ozonelmy
/framework/ios/ @ozonelmy @wwwcg

# framework: voltron
/framework/voltron/ @lvfen @skindhu
Expand All @@ -47,34 +47,34 @@ CMakeLists.txt @ilikethese @etkmao
/dom/ @etkmao @ilikethese

# renderer: native
/renderer/native/android/ @siguangli
/renderer/native/ios/ @ozonelmy
/renderer/native/android/ @siguangli @iPel
/renderer/native/ios/ @ozonelmy @wwwcg

# renderer: tdf
/renderer/tdf/ @vimerzhao
/renderer/tdf/android/ @siguangli
/renderer/tdf/android/ @siguangli @iPel
/renderer/tdf/android/**/src/main/cpp/ @ilikethese @etkmao
/renderer/tdf/ios/ @ozonelmy
/renderer/tdf/ios/ @ozonelmy @wwwcg

# renderer: voltron
/renderer/voltron/ @lvfen @skindhu

# module: vfs
/modules/vfs/ @etkmao @ilikethese
/modules/vfs/android/ @siguangli
/modules/vfs/android/ @siguangli @iPel
/modules/vfs/android/**/src/main/cpp/ @etkmao @ilikethese
/modules/vfs/ios/ @ozonelmy
/modules/vfs/ios/ @ozonelmy @wwwcg
/modules/vfs/voltron/ @lvfen @skindhu

# module: voltron
/modules/voltron/ @lvfen @skindhu

# module: android
/modules/android/ @siguangli
/modules/android/ @siguangli @iPel
/modules/android/jni/ @etkmao @ilikethese

# module: ios
/modules/ios/ @ozonelmy
/modules/ios/ @ozonelmy @wwwcg

# module: footstone
/modules/footstone/ @etkmao @ilikethese
Expand All @@ -86,27 +86,27 @@ CMakeLists.txt @ilikethese @etkmao
/.github/ @zealotchen0

# doc: example
/framework/examples/android-demo/ @siguangli
/framework/examples/android-demo/ @siguangli @iPel
/framework/examples/android-demo/res/ @zealotchen0
/framework/examples/ios-demo/ @ozonelmy
/framework/examples/ios-demo/ @ozonelmy @wwwcg
/framework/examples/ios-demo/res/ @zealotchen0

# doc: pages
/*.md @zealotchen0
/docs/ @zealotchen0

# build: gradle
/gradle.properties @siguangli
/gradlew @siguangli
/gradlew.bat @siguangli
/settings.gradle @siguangli
/build.gradle @siguangli
/gradle/ @siguangli
/gradle.properties @siguangli @iPel
/gradlew @siguangli @iPel
/gradlew.bat @siguangli @iPel
/settings.gradle @siguangli @iPel
/build.gradle @siguangli @iPel
/gradle/ @siguangli @iPel

# build: xcode
/HippySDK.xcworkspace/ @ozonelmy
/hippy.podspec @ozonelmy
/xcodeinitscript.sh @ozonelmy
/HippySDK.xcworkspace/ @ozonelmy @wwwcg
/hippy.podspec @ozonelmy @wwwcg
/xcodeinitscript.sh @ozonelmy @wwwcg

# build: config
/buildconfig/ @ilikethese @etkmao
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/pod_spec_lint.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/pod_spec_lint_bypass.yml

This file was deleted.

6 changes: 3 additions & 3 deletions PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The front-end Uses [lerna](https://lerna.js.org/) for versioning and CHANGELOG g
Update version and CHANGELOG usage:

```bash
npx lerna version [VERSION] --conventional-commits --tag-version-prefix='' --no-push
npx lerna version [VERSION] --force-publish --conventional-commits --tag-version-prefix='' --no-push
```

* `[version]` - The version number to be released, such as 2.1.0.
Expand Down Expand Up @@ -84,10 +84,10 @@ Enter a commit message that conforms to [Convention Commit](https://conventional
git commit -m 'chore(release): released [VERSION]'
```

tag
tag (如果是大版本, 在主干打tag, 如果是hotfix,在hotfix分支打tag,然后把changelog合回主干)

```bash
git tag [VERSION]
git tag -a [VERSION] -m "version release xxx"
```

Commit the code and prepare to publish the PR merge into the master branch.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class DevToolsUtil {
static void AppendDomKeyValue(std::string& node_str,
bool& first_object,
const std::string& node_key,
const HippyValue& dom_value);
const HippyValue& hippy_value);
static LayoutResult GetLayoutOnScreen(const std::shared_ptr<DomNode>& root_node, const std::shared_ptr<DomNode>& dom_node);
};
} // namespace hippy::devtools
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ void HippyScreenAdapter::RemovePostFrameCallback(uint64_t id) {
}

hippy::dom::DomArgument HippyScreenAdapter::makeFrameCallbackArgument(uint64_t id) const {
footstone::value::HippyValue::HippyValueObjectType dom_value_object;
dom_value_object[kFrameCallbackId] = footstone::value::HippyValue(static_cast<int32_t>(id));
footstone::value::HippyValue::DomValueArrayType dom_value_array;
dom_value_array.push_back(footstone::value::HippyValue(dom_value_object));
footstone::value::HippyValue argument_dom_value(dom_value_array);
hippy::dom::DomArgument argument(argument_dom_value);
footstone::value::HippyValue::HippyValueObjectType hippy_value_object;
hippy_value_object[kFrameCallbackId] = footstone::value::HippyValue(static_cast<int32_t>(id));
footstone::value::HippyValue::HippyValueArrayType hippy_value_array;
hippy_value_array.push_back(footstone::value::HippyValue(hippy_value_object));
footstone::value::HippyValue argument_hippy_value(hippy_value_array);
hippy::dom::DomArgument argument(argument_hippy_value);
return argument;
}

Expand All @@ -97,36 +97,36 @@ void HippyScreenAdapter::GetScreenShot(const hippy::devtools::ScreenRequest& req
hippy::dom::DomArgument argument = makeScreenRequestArgument(request);
auto screen_shot_callback = [WEAK_THIS, callback](std::shared_ptr<hippy::dom::DomArgument> arg) {
DEFINE_AND_CHECK_SELF(HippyScreenAdapter)
footstone::value::HippyValue result_dom_value;
arg->ToObject(result_dom_value);
footstone::value::HippyValue::HippyValueObjectType base64_dom_value;
if (result_dom_value.IsArray() && !result_dom_value.ToArrayChecked().empty()) {
base64_dom_value = result_dom_value.ToArrayChecked()[0].ToObjectChecked();
} else if (result_dom_value.IsObject()) {
base64_dom_value = result_dom_value.ToObjectChecked();
footstone::value::HippyValue result_hippy_value;
arg->ToObject(result_hippy_value);
footstone::value::HippyValue::HippyValueObjectType base64_hippy_value;
if (result_hippy_value.IsArray() && !result_hippy_value.ToArrayChecked().empty()) {
base64_hippy_value = result_hippy_value.ToArrayChecked()[0].ToObjectChecked();
} else if (result_hippy_value.IsObject()) {
base64_hippy_value = result_hippy_value.ToObjectChecked();
} else {
// don't have screenshot
return;
}
std::string base64_str = base64_dom_value.find(kScreenShot)->second.ToStringChecked();
int32_t width = base64_dom_value.find(kScreenWidth)->second.ToInt32Checked();
int32_t height = base64_dom_value.find(kScreenHeight)->second.ToInt32Checked();
self->screen_scale_ = base64_dom_value.find(kScreenScale)->second.ToDoubleChecked();
std::string base64_str = base64_hippy_value.find(kScreenShot)->second.ToStringChecked();
int32_t width = base64_hippy_value.find(kScreenWidth)->second.ToInt32Checked();
int32_t height = base64_hippy_value.find(kScreenHeight)->second.ToInt32Checked();
self->screen_scale_ = base64_hippy_value.find(kScreenScale)->second.ToDoubleChecked();
callback(base64_str, width, height);
};
children[0]->CallFunction(kGetScreenShot, argument, screen_shot_callback);
}
}

hippy::dom::DomArgument HippyScreenAdapter::makeScreenRequestArgument(const ScreenRequest& request) const {
footstone::value::HippyValue::HippyValueObjectType dom_value_object;
dom_value_object[kRequestMaxWidth] = footstone::value::HippyValue(request.req_width);
dom_value_object[kRequestMaxHeight] = footstone::value::HippyValue(request.req_height);
dom_value_object[kQuality] = footstone::value::HippyValue(request.quality);
footstone::value::HippyValue::DomValueArrayType dom_value_array;
dom_value_array.push_back(footstone::value::HippyValue(dom_value_object));
footstone::value::HippyValue argument_dom_value(dom_value_array);
hippy::dom::DomArgument argument(argument_dom_value);
footstone::value::HippyValue::HippyValueObjectType hippy_value_object;
hippy_value_object[kRequestMaxWidth] = footstone::value::HippyValue(request.req_width);
hippy_value_object[kRequestMaxHeight] = footstone::value::HippyValue(request.req_height);
hippy_value_object[kQuality] = footstone::value::HippyValue(request.quality);
footstone::value::HippyValue::HippyValueArrayType hippy_value_array;
hippy_value_array.push_back(footstone::value::HippyValue(hippy_value_object));
footstone::value::HippyValue argument_hippy_value(hippy_value_array);
hippy::dom::DomArgument argument(argument_hippy_value);
return argument;
}
} // namespace hippy::devtools
60 changes: 30 additions & 30 deletions devtools/devtools-integration/native/src/devtools_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,22 @@ LayoutResult DevToolsUtil::GetLayoutOnScreen(const std::shared_ptr<DomNode>& roo
if (!find_node) {
return layout_result;
}
footstone::value::HippyValue::HippyValueObjectType dom_value_object;
dom_value_object["id"] = footstone::value::HippyValue(1);
footstone::value::HippyValue::DomValueArrayType dom_value_array;
dom_value_array.push_back(footstone::value::HippyValue(dom_value_object));
footstone::value::HippyValue argument_dom_value(dom_value_array);
hippy::dom::DomArgument argument(argument_dom_value);
footstone::value::HippyValue::HippyValueObjectType hippy_value_object;
hippy_value_object["id"] = footstone::value::HippyValue(1);
footstone::value::HippyValue::HippyValueArrayType hippy_value_array;
hippy_value_array.push_back(footstone::value::HippyValue(hippy_value_object));
footstone::value::HippyValue argument_hippy_value(hippy_value_array);
hippy::dom::DomArgument argument(argument_hippy_value);
auto screen_shot_callback =
MakeCopyable([promise = std::move(layout_promise)](std::shared_ptr<hippy::dom::DomArgument> arg) mutable {
footstone::value::HippyValue result_dom_value;
arg->ToObject(result_dom_value);
footstone::value::HippyValue result_hippy_value;
arg->ToObject(result_hippy_value);
footstone::value::HippyValue::HippyValueObjectType result_dom_object;
LayoutResult result;
if (result_dom_value.IsArray() && !result_dom_value.ToArrayChecked().empty()) {
result_dom_object = result_dom_value.ToArrayChecked()[0].ToObjectChecked();
} else if (result_dom_value.IsObject()) {
result_dom_object = result_dom_value.ToObjectChecked();
if (result_hippy_value.IsArray() && !result_hippy_value.ToArrayChecked().empty()) {
result_dom_object = result_hippy_value.ToArrayChecked()[0].ToObjectChecked();
} else if (result_hippy_value.IsObject()) {
result_dom_object = result_hippy_value.ToObjectChecked();
} else {
// maybe flat ui optimization and remove it
promise.set_value(result);
Expand All @@ -218,14 +218,14 @@ LayoutResult DevToolsUtil::GetLayoutOnScreen(const std::shared_ptr<DomNode>& roo
return layout_result;
}

std::string DevToolsUtil::ParseDomValue(const HippyValue& dom_value) {
if (!dom_value.IsObject()) {
std::string DevToolsUtil::ParseDomValue(const HippyValue& hippy_value) {
if (!hippy_value.IsObject()) {
FOOTSTONE_DLOG(INFO) << kDevToolsTag << "ParseTotalProps, node props is not object";
return "{}";
}
std::string node_str = "{";
bool first_object = true;
for (auto iterator : dom_value.ToObjectChecked()) {
for (auto iterator : hippy_value.ToObjectChecked()) {
if (iterator.first == "uri" || iterator.first == "src") {
iterator.second = "";
}
Expand Down Expand Up @@ -347,40 +347,40 @@ std::string DevToolsUtil::ParseNodeProps(const std::unordered_map<std::string, H
void DevToolsUtil::AppendDomKeyValue(std::string& node_str,
bool& first_object,
const std::string& node_key,
const HippyValue& dom_value) {
if (dom_value.IsBoolean()) {
const HippyValue& hippy_value) {
if (hippy_value.IsBoolean()) {
node_str += first_object ? "\"" : ",\"";
node_str += node_key;
node_str += "\":";
node_str += dom_value.ToBooleanChecked() ? "true" : "false";
node_str += hippy_value.ToBooleanChecked() ? "true" : "false";
first_object = false;
} else if (dom_value.IsInt32()) {
} else if (hippy_value.IsInt32()) {
node_str += first_object ? "\"" : ",\"";
node_str += node_key;
node_str += "\":";
node_str += std::to_string(dom_value.ToInt32Checked());
node_str += std::to_string(hippy_value.ToInt32Checked());
first_object = false;
} else if (dom_value.IsUInt32()) {
} else if (hippy_value.IsUInt32()) {
node_str += first_object ? "\"" : ",\"";
node_str += node_key;
node_str += "\":";
node_str += std::to_string(dom_value.IsUInt32());
node_str += std::to_string(hippy_value.IsUInt32());
first_object = false;
} else if (dom_value.IsDouble()) {
} else if (hippy_value.IsDouble()) {
node_str += first_object ? "\"" : ",\"";
node_str += node_key;
node_str += "\":";
node_str += std::to_string(dom_value.ToDoubleChecked());
node_str += std::to_string(hippy_value.ToDoubleChecked());
first_object = false;
} else if (dom_value.IsString()) {
} else if (hippy_value.IsString()) {
node_str += first_object ? "\"" : ",\"";
node_str += node_key;
node_str += "\":\"";
node_str += dom_value.ToStringChecked();
node_str += hippy_value.ToStringChecked();
node_str += "\"";
first_object = false;
} else if (dom_value.IsArray()) {
auto props_array = dom_value.ToArrayChecked();
} else if (hippy_value.IsArray()) {
auto props_array = hippy_value.ToArrayChecked();
std::string array = "[";
for (auto it = props_array.begin(); it != props_array.end(); ++it) {
if (it->IsNull() || it->IsUndefined()) {
Expand All @@ -397,11 +397,11 @@ void DevToolsUtil::AppendDomKeyValue(std::string& node_str,
node_str += "\":";
node_str += array;
first_object = false;
} else if (dom_value.IsObject()) {
} else if (hippy_value.IsObject()) {
node_str += first_object ? "\"" : ",\"";
node_str += node_key;
node_str += "\":";
node_str += ParseDomValue(dom_value);
node_str += ParseDomValue(hippy_value);
first_object = false;
}
}
Expand Down
Loading

0 comments on commit 0e00cfc

Please sign in to comment.