Skip to content

Commit

Permalink
feat(core): allow all schemas to dynamic load (Tencent#2829)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj authored and etkmao committed Mar 14, 2023
1 parent 9a72ddd commit 4ecf8b0
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 48 deletions.
4 changes: 2 additions & 2 deletions driver/js/lib/global/DynamicLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Tencent is pleased to support the open source community by making
* Hippy available.
*
* Copyright (C) 2017-2019 THL A29 Limited, a Tencent company.
* Copyright (C) 2017-2022 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -25,7 +25,7 @@ const ContextifyModule = internalBinding('ContextifyModule');

global.dynamicLoad = (path, encode, cb) => {
let requestPath = path || '';
const isSchema = ['https://', 'http://', '//'].some(schema => requestPath.indexOf(schema) === 0);
const isSchema = /^(.+:\/\/)|^(\/\/)/.test(path);
if (!isSchema) {
requestPath = global.__HIPPYCURDIR__ + path;
}
Expand Down
4 changes: 2 additions & 2 deletions driver/js/scripts/build-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,5 @@ function generateCpp(platform, buildDirPath) {

// Start to work
generateCpp('ios', getAbsolutePath('../../../framework/ios/base'));
generateCpp('android', getAbsolutePath('../../../framework/android/src/main/cpp/src/bridge/'));
generateCpp('flutter', getAbsolutePath('../flutter/core/src/bridge/'));
generateCpp('android', getAbsolutePath('../../../framework/android/connector/driver/js/src/main/cpp/src/'));
generateCpp('flutter', getAbsolutePath('../../../framework/voltron/core/src/bridge/'));
Loading

0 comments on commit 4ecf8b0

Please sign in to comment.