Skip to content

Commit e614fd2

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/hmr-improvements
2 parents 155acd3 + 90ab54a commit e614fd2

File tree

16 files changed

+152
-63
lines changed

16 files changed

+152
-63
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: 'Checkout Repository'
20-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
- name: 'Dependency Review'
2222
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0

.github/workflows/npm_release.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
jobs:
2020
build:
2121
name: Build
22-
runs-on: macos-13
22+
runs-on: macos-15-intel
2323
outputs:
2424
npm_version: ${{ steps.npm_version_output.outputs.NPM_VERSION }}
2525
npm_tag: ${{ steps.npm_version_output.outputs.NPM_TAG }}
@@ -29,15 +29,15 @@ jobs:
2929
with:
3030
egress-policy: audit
3131

32-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
32+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3333
with:
3434
fetch-depth: 0
3535
submodules: true
36-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
36+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3737
with:
3838
node-version: 22
3939
registry-url: "https://registry.npmjs.org"
40-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
40+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
4141
with:
4242
distribution: "temurin"
4343
java-version: "21"
@@ -81,34 +81,34 @@ jobs:
8181
- name: Build npm package
8282
run: ./gradlew -PgitCommitVersion=${{ github.sha }} -PnoCCache --stacktrace
8383
- name: Upload npm package artifact
84-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
84+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8585
with:
8686
name: npm-package
8787
path: dist/nativescript-android-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
8888
- name: Upload debug symbols
89-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
89+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
9090
with:
9191
name: debug-symbols
9292
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
9393

9494
test:
9595
name: Test
96-
runs-on: macos-13
96+
runs-on: macos-15-intel
9797
needs: build
9898
steps:
9999
- name: Harden the runner (Audit all outbound calls)
100100
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
101101
with:
102102
egress-policy: audit
103103

104-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
104+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
105105
with:
106106
submodules: true
107-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
107+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
108108
with:
109109
node-version: 22
110110
registry-url: "https://registry.npmjs.org"
111-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
111+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
112112
with:
113113
distribution: "temurin"
114114
java-version: "21"
@@ -160,11 +160,11 @@ jobs:
160160
with:
161161
egress-policy: audit
162162

163-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
163+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
164164
with:
165165
node-version: 22
166166
registry-url: "https://registry.npmjs.org"
167-
- uses: actions/download-artifact@v4
167+
- uses: actions/download-artifact@v6
168168
with:
169169
name: npm-package
170170
path: dist
@@ -191,19 +191,19 @@ jobs:
191191
with:
192192
egress-policy: audit
193193

194-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
194+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
195195
with:
196196
fetch-depth: 0
197-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
197+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
198198
with:
199199
node-version: 22
200200
- name: Setup
201201
run: npm install
202-
- uses: actions/download-artifact@v4
202+
- uses: actions/download-artifact@v6
203203
with:
204204
name: npm-package
205205
path: dist
206-
- uses: actions/download-artifact@v4
206+
- uses: actions/download-artifact@v6
207207
with:
208208
name: debug-symbols
209209
path: dist/debug-symbols

.github/workflows/pull_request.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ permissions:
1616
jobs:
1717
build:
1818
name: Build
19-
runs-on: macos-13
19+
runs-on: macos-15-intel
2020
outputs:
2121
npm_version: ${{ steps.npm_version_output.outputs.NPM_VERSION }}
2222
npm_tag: ${{ steps.npm_version_output.outputs.NPM_TAG }}
2323
steps:
24-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525
with:
2626
fetch-depth: 0
2727
submodules: true
28-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
28+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2929
with:
3030
node-version: 22
3131
registry-url: "https://registry.npmjs.org"
32-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
32+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
3333
with:
3434
distribution: "temurin"
3535
java-version: "21"
@@ -73,28 +73,28 @@ jobs:
7373
- name: Build npm package
7474
run: ./gradlew -PgitCommitVersion=${{ github.sha }} -PnoCCache --stacktrace
7575
- name: Upload npm package artifact
76-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
76+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
7777
with:
7878
name: npm-package
7979
path: dist/nativescript-android-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
8080
- name: Upload debug symbols
81-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
81+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8282
with:
8383
name: debug-symbols
8484
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
8585
test:
8686
name: Test
87-
runs-on: macos-13
87+
runs-on: macos-15-intel
8888
needs: build
8989
steps:
90-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
90+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9191
with:
9292
submodules: true
93-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
93+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
9494
with:
9595
node-version: 22
9696
registry-url: "https://registry.npmjs.org"
97-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
97+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
9898
with:
9999
distribution: "temurin"
100100
java-version: "21"

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434

3535
- name: "Checkout code"
36-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
36+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3737
with:
3838
persist-credentials: false
3939

@@ -60,7 +60,7 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
63+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6464
with:
6565
name: SARIF file
6666
path: results.sarif
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Test ES Module
2+
export const message = "Hello from ES Module!";
3+
export function greet(name) {
4+
return `Hello, ${name}!`;
5+
}
6+
7+
export const moduleType = "ES Module";
8+
export const version = "1.0.0";
9+
10+
// Export object with multiple properties
11+
export const utilities = {
12+
add: (a, b) => a + b,
13+
multiply: (a, b) => a * b,
14+
format: (str) => `[${str}]`
15+
};
16+
17+
// Default export
18+
const defaultExport = {
19+
type: "ESModule",
20+
version: "1.0.0",
21+
features: ["exports", "imports", "default-export"],
22+
status: "working"
23+
};
24+
25+
export default defaultExport;

test-app/app/src/main/assets/app/tests/testESModules.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@ function runESModuleTests() {
55
// Test 1: Load .mjs files as ES modules
66
console.log("\n--- Test 1: Loading .mjs files as ES modules ---");
77
try {
8-
var moduleExports = require("~/test-es-module.mjs");
8+
var moduleExports = require("~/testSimpleESModule.mjs");
99
if (moduleExports && moduleExports !== null) {
1010
console.log("Module exports:", JSON.stringify(moduleExports));
1111
passed++;
1212
} else {
1313
console.log("❌ FAIL: ES Module loaded but exports are null");
1414
failed++;
1515
}
16+
if (moduleExports.moduleType === "ES Module") {
17+
console.log(" - moduleType check passed");
18+
passed++;
19+
} else {
20+
console.log("❌ FAIL: moduleType check failed");
21+
failed++;
22+
}
1623
} catch (e) {
1724
console.log("❌ FAIL: Error loading ES module:", e.message);
1825
failed++;
@@ -84,9 +91,9 @@ function runESModuleTests() {
8491
console.log("Total tests:", passed + failed);
8592

8693
if (failed === 0) {
87-
console.log("🎉 ALL ES MODULE TESTS PASSED!");
94+
console.log("ALL ES MODULE TESTS PASSED!");
8895
} else {
89-
console.log("💥 SOME ES MODULE TESTS FAILED!");
96+
console.log("SOME ES MODULE TESTS FAILED!");
9097
}
9198

9299
return { passed: passed, failed: failed };

test-app/build-tools/static-binding-generator/src/main/java/org/nativescript/staticbindinggenerator/Generator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public Binding generateBinding(DataRow dataRow, HashSet<String> interfaceNames)
156156
} else {
157157
name = getSimpleClassname(clazz.getClassName().replace("$", "_")) + "_";
158158
// Generate a unique identifier that prevents naming collisions
159-
// especially with .mjs files and complex Angular component structures
159+
// especially with .mjs files and complex structures
160160
String fileIdentifier = generateUniqueFileIdentifier(dataRow.getFile());
161161
name += fileIdentifier + "_" + dataRow.getLine() + "_" + dataRow.getColumn() + "_" + dataRow.getNewClassName();
162162
}

test-app/runtime/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ allprojects {
152152
afterEvaluate {
153153
tasks.withType(JavaCompile).configureEach {
154154
// remove after "-Xlint:-classfile" https://issuetracker.google.com/issues/359561906
155-
// todo remove "-Xlint:-this-escape" after updating runtime-binding-generator
156-
options.compilerArgs << "-Xlint:all" << "-Werror" << "-Xlint:-classfile" << "-Xlint:-this-escape"
155+
options.compilerArgs << "-Xlint:all" << "-Werror" << "-Xlint:-classfile"
156+
if (javaVersion.current() >= JavaVersion.VERSION_21) {
157+
// todo remove "-Xlint:-this-escape" after updating runtime-binding-generator
158+
options.compilerArgs << "-Xlint:-this-escape"
159+
}
157160
}
158161
}
159162
}

test-app/runtime/src/main/cpp/JEnv.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class JEnv {
2020

2121
jsize GetArrayLength(jarray array);
2222

23+
inline bool isSameObject(jobject obj1, jobject obj2) {
24+
return m_env->IsSameObject(obj1, obj2) == JNI_TRUE;
25+
}
26+
2327
jmethodID GetMethodID(jclass clazz, const std::string& name, const std::string& sig);
2428
jmethodID GetStaticMethodID(jclass clazz, const std::string& name, const std::string& sig);
2529
std::pair<jmethodID,jclass> GetInterfaceStaticMethodIDAndJClass(

0 commit comments

Comments
 (0)