Skip to content

Commit abae298

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/windows-merge
# Conflicts: # packages/vite/hmr/server/websocket-ns-m-request.ts # packages/vite/hmr/shared/vendor/manifest.spec.ts
2 parents f301728 + 58063e6 commit abae298

42 files changed

Lines changed: 1674 additions & 222 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/automated/src/ui/layouts/flexbox-layout-tests.ts‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,3 +1834,48 @@ export const testLiquidGlassViews_do_not_crash_when_updating_iosGlassEffect = is
18341834
TKUnit.assertTrue(root.isLoaded, 'Liquid glass view tree should remain loaded after glass effect updates.');
18351835
})
18361836
: undefined;
1837+
1838+
let getGlassViews = (template: string) => {
1839+
let root = Builder.parse(template);
1840+
1841+
return {
1842+
root,
1843+
parent: root.getViewById('parent') as View,
1844+
glass: root.getViewById('glass') as View,
1845+
child: root.getViewById('child') as View,
1846+
};
1847+
};
1848+
1849+
// Parents subtract only a child's margins from its measure spec, so glass views must deduct their own padding.
1850+
1851+
let activity_liquidglass_padding = () =>
1852+
getGlassViews(
1853+
`<FlexboxLayout iosOverflowSafeArea="false" id="parent" width="300" height="300" flexDirection="${FlexDirection.ROW}" backgroundColor="gray">
1854+
<LiquidGlass id="glass" width="300" height="100" paddingLeft="20" paddingRight="20">
1855+
<Label id="child" text="content" horizontalAlignment="stretch" />
1856+
</LiquidGlass>
1857+
</FlexboxLayout>`,
1858+
);
1859+
1860+
export const testLiquidGlassFlexboxLayout_padding_measures_content_box = isIOS
1861+
? test(activity_liquidglass_padding, noop, ({ glass, child }) => {
1862+
closeEnough(width(child), dipToDp(260), `Expected ${child} width to equal glass width minus 2x20 padding`);
1863+
isLeftWith(glass, child, dipToDp(20), `Expected ${child} to start 20dip inside ${glass}`);
1864+
})
1865+
: undefined;
1866+
1867+
let activity_liquidglasscontainer_autowidth = () =>
1868+
getGlassViews(
1869+
`<FlexboxLayout iosOverflowSafeArea="false" id="parent" flexDirection="${FlexDirection.ROW}" alignItems="${AlignItems.FLEX_START}" backgroundColor="gray">
1870+
<LiquidGlassContainer id="glass" paddingLeft="20" paddingRight="20" paddingTop="10" paddingBottom="10">
1871+
<Label id="child" width="100" height="40" />
1872+
</LiquidGlassContainer>
1873+
</FlexboxLayout>`,
1874+
);
1875+
1876+
export const testLiquidGlassContainerFlexboxLayout_padding_wraps_content = isIOS
1877+
? test(activity_liquidglasscontainer_autowidth, noop, ({ glass }) => {
1878+
closeEnough(width(glass), dipToDp(140), `Expected ${glass} width to equal child width plus 2x20 padding`);
1879+
closeEnough(height(glass), dipToDp(60), `Expected ${glass} height to equal child height plus 2x10 padding`);
1880+
})
1881+
: undefined;

‎apps/automated/src/ui/scroll-view/scroll-view-tests.ts‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,37 @@ class ScrollLayoutTest extends UITest<ScrollView> {
126126
TKUnit.assertAreClose(layoutHelper.dip(this.testView.scrollableWidth), 300, 0.4, 'this.testView.scrollableWidth');
127127
}
128128

129+
public test_scrollableHeight_includes_bottom_content_inset() {
130+
if (!__APPLE__) {
131+
return;
132+
}
133+
this.waitUntilTestElementLayoutIsValid();
134+
const native = this.testView.ios as UIScrollView;
135+
const before = this.testView.scrollableHeight;
136+
native.contentInset = new UIEdgeInsets({ top: 0, left: 0, bottom: 50, right: 0 });
137+
138+
TKUnit.assertAreClose(this.testView.scrollableHeight, before + 50, 0.1, 'scrollableHeight with a bottom inset');
139+
this.testView.scrollToVerticalOffset(this.testView.scrollableHeight, false);
140+
const end = native.contentSize.height + native.adjustedContentInset.bottom - native.bounds.size.height;
141+
TKUnit.assertAreClose(native.contentOffset.y, end, 0.1, 'scrollToVerticalOffset(scrollableHeight) reaches the end above the inset');
142+
}
143+
144+
public test_scrollableWidth_includes_right_content_inset() {
145+
if (!__APPLE__) {
146+
return;
147+
}
148+
this.testView.orientation = 'horizontal';
149+
this.waitUntilTestElementLayoutIsValid();
150+
const native = this.testView.ios as UIScrollView;
151+
const before = this.testView.scrollableWidth;
152+
native.contentInset = new UIEdgeInsets({ top: 0, left: 0, bottom: 0, right: 40 });
153+
154+
TKUnit.assertAreClose(this.testView.scrollableWidth, before + 40, 0.1, 'scrollableWidth with a right inset');
155+
this.testView.scrollToHorizontalOffset(this.testView.scrollableWidth, false);
156+
const end = native.contentSize.width + native.adjustedContentInset.right - native.bounds.size.width;
157+
TKUnit.assertAreClose(native.contentOffset.x, end, 0.1, 'scrollToHorizontalOffset(scrollableWidth) reaches the end beside the inset');
158+
}
159+
129160
public test_scrollToVerticalOffset_no_animation() {
130161
TKUnit.assertEqual(this.testView.verticalOffset, 0, 'this.testView.verticalOffset');
131162
this.waitUntilTestElementLayoutIsValid();

‎packages/core/ui/layouts/liquid-glass-container/index.ios.ts‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -55,44 +55,6 @@ export class LiquidGlassContainer extends LiquidGlassContainerCommon {
5555
return false;
5656
}
5757

58-
// When LiquidGlassContainer is a child of FlexboxLayout (or any layout that passes
59-
// a measure spec already reduced by the child's padding), AbsoluteLayout.onMeasure
60-
// would subtract our padding a second time. To prevent this double-deduction we
61-
// temporarily zero the effective padding/border values before delegating to the
62-
// AbsoluteLayout measurement, then restore them immediately after.
63-
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
64-
const pl = this.effectivePaddingLeft;
65-
const pr = this.effectivePaddingRight;
66-
const pt = this.effectivePaddingTop;
67-
const pb = this.effectivePaddingBottom;
68-
const bl = this.effectiveBorderLeftWidth;
69-
const br = this.effectiveBorderRightWidth;
70-
const bt = this.effectiveBorderTopWidth;
71-
const bb = this.effectiveBorderBottomWidth;
72-
73-
this.effectivePaddingLeft = 0;
74-
this.effectivePaddingRight = 0;
75-
this.effectivePaddingTop = 0;
76-
this.effectivePaddingBottom = 0;
77-
this.effectiveBorderLeftWidth = 0;
78-
this.effectiveBorderRightWidth = 0;
79-
this.effectiveBorderTopWidth = 0;
80-
this.effectiveBorderBottomWidth = 0;
81-
82-
try {
83-
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
84-
} finally {
85-
this.effectivePaddingLeft = pl;
86-
this.effectivePaddingRight = pr;
87-
this.effectivePaddingTop = pt;
88-
this.effectivePaddingBottom = pb;
89-
this.effectiveBorderLeftWidth = bl;
90-
this.effectiveBorderRightWidth = br;
91-
this.effectiveBorderTopWidth = bt;
92-
this.effectiveBorderBottomWidth = bb;
93-
}
94-
}
95-
9658
// When children animate with translate (layer transform), UIVisualEffectView-based
9759
// container effects may recompute based on the underlying frames (not transforms),
9860
// which can cause jumps. Normalize any residual translation into the

‎packages/core/ui/layouts/liquid-glass/index.ios.ts‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,44 +48,6 @@ export class LiquidGlass extends LiquidGlassCommon {
4848
return false;
4949
}
5050

51-
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
52-
// When LiquidGlass is a child of FlexboxLayout (or any layout that passes a child
53-
// measure spec already reduced by the child's padding), GridLayout.onMeasure would
54-
// subtract our padding a second time. To prevent this double-deduction we temporarily
55-
// zero the effective padding/border values before delegating to the GridLayout
56-
// measurement, then restore them immediately after.
57-
const pl = this.effectivePaddingLeft;
58-
const pr = this.effectivePaddingRight;
59-
const pt = this.effectivePaddingTop;
60-
const pb = this.effectivePaddingBottom;
61-
const bl = this.effectiveBorderLeftWidth;
62-
const br = this.effectiveBorderRightWidth;
63-
const bt = this.effectiveBorderTopWidth;
64-
const bb = this.effectiveBorderBottomWidth;
65-
66-
this.effectivePaddingLeft = 0;
67-
this.effectivePaddingRight = 0;
68-
this.effectivePaddingTop = 0;
69-
this.effectivePaddingBottom = 0;
70-
this.effectiveBorderLeftWidth = 0;
71-
this.effectiveBorderRightWidth = 0;
72-
this.effectiveBorderTopWidth = 0;
73-
this.effectiveBorderBottomWidth = 0;
74-
75-
try {
76-
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
77-
} finally {
78-
this.effectivePaddingLeft = pl;
79-
this.effectivePaddingRight = pr;
80-
this.effectivePaddingTop = pt;
81-
this.effectivePaddingBottom = pb;
82-
this.effectiveBorderLeftWidth = bl;
83-
this.effectiveBorderRightWidth = br;
84-
this.effectiveBorderTopWidth = bt;
85-
this.effectiveBorderBottomWidth = bb;
86-
}
87-
}
88-
8951
public onLayout(left: number, top: number, right: number, bottom: number): void {
9052
// GridLayout.onLayout computes column/row offsets relative to (left, top), then
9153
// adds its own padding on top. Since the FlexboxLayout (or parent) already placed

‎packages/core/ui/scroll-view/index.ios.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,24 @@ export class ScrollView extends ScrollViewBase {
134134
return this.nativeViewProtected ? this.nativeViewProtected.contentOffset.y : 0;
135135
}
136136

137+
// Each is the largest offset a scroll reaches, end inset included, so scrolling to it shows the end of the
138+
// content above a keyboard or docked bar that sets contentInset.bottom.
137139
get scrollableWidth(): number {
138140
if (!this.nativeViewProtected || this.orientation !== 'horizontal') {
139141
return 0;
140142
}
141143

142-
return Math.max(0, this.nativeViewProtected.contentSize.width - this.nativeViewProtected.bounds.size.width);
144+
const nativeView = this.nativeViewProtected;
145+
return Math.max(0, nativeView.contentSize.width + nativeView.adjustedContentInset.right - nativeView.bounds.size.width);
143146
}
144147

145148
get scrollableHeight(): number {
146149
if (!this.nativeViewProtected || this.orientation !== 'vertical') {
147150
return 0;
148151
}
149152

150-
return Math.max(0, this.nativeViewProtected.contentSize.height - this.nativeViewProtected.bounds.size.height);
153+
const nativeView = this.nativeViewProtected;
154+
return Math.max(0, nativeView.contentSize.height + nativeView.adjustedContentInset.bottom - nativeView.bounds.size.height);
151155
}
152156

153157
[isScrollEnabledProperty.getDefault](): boolean {

‎packages/vite/CHANGELOG.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
## 8.0.21 (2026-10-22)
2+
3+
### 🩹 Fixes
4+
5+
- **vite:** recognize aliased default exports in link checks ([#11567](https://github.com/NativeScript/NativeScript/pull/11567))
6+
- **vite:** preserve package imports during vendor bundling ([#11565](https://github.com/NativeScript/NativeScript/pull/11565))
7+
8+
### ❤️ Thank You
9+
10+
- Alec Larson @aleclarson
11+
12+
## 8.0.20 (2026-10-21)
13+
14+
### 🩹 Fixes
15+
16+
- **vite:** apply app.css before the app entry on HMR dev boots ([#11522](https://github.com/NativeScript/NativeScript/pull/11522))
17+
- **vite:** keep source-only dependencies out of the HMR vendor bundle regardless of spec ([#11560](https://github.com/NativeScript/NativeScript/pull/11560))
18+
- **vite:** resolve nested node_modules requests for install-linked dependencies ([#11559](https://github.com/NativeScript/NativeScript/pull/11559))
19+
- **vite:** preserve Vue plugin imports and canonical runtime bridge ([#11555](https://github.com/NativeScript/NativeScript/pull/11555))
20+
- **vite:** give HMR deps-bundle shims the named exports of CommonJS and minified ESM ([#11543](https://github.com/NativeScript/NativeScript/pull/11543))
21+
- **vite:** keep `value: undefined` in HMR-served Vue scripts ([#11542](https://github.com/NativeScript/NativeScript/pull/11542))
22+
- **vite:** keep the ?raw query on HMR imports ([#11541](https://github.com/NativeScript/NativeScript/pull/11541))
23+
- **vite:** serve a plugin module under one URL whether imported or re-exported ([#11540](https://github.com/NativeScript/NativeScript/pull/11540))
24+
- **vite:** emit the Android activity chunk under a stable name ([#11539](https://github.com/NativeScript/NativeScript/pull/11539))
25+
- **vite:** keep the rules after @layer, @container and other at-rules css can't parse ([#11538](https://github.com/NativeScript/NativeScript/pull/11538))
26+
27+
### ❤️ Thank You
28+
29+
- Alec Larson @aleclarson
30+
- Nathan Walker
31+
- Osei Fortune @triniwiz
32+
- Rafael Augusto @rafaelaugustos
33+
134
## 8.0.19 (2026-10-12)
235

336
### 🩹 Fixes

‎packages/vite/configuration/base.ts‎

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
1010
import { getCliFlags } from '../helpers/cli-flags.js';
1111
import NativeScriptPlugin from '../helpers/resolver.js';
1212
import nsConfigAsJsonPlugin from '../helpers/config-as-json.js';
13-
import { findMonorepoWorkspaceRoot, getProjectRootPath } from '../helpers/project.js';
13+
import { getDevServerFsAllow, getProjectRootPath } from '../helpers/project.js';
1414
import { aliasCssTree } from '../helpers/css-tree.js';
1515
import { getGlobalDefines } from '../helpers/global-defines.js';
1616
import { getWorkerPlugins, workerHmrUrlPlugin, workerUrlPlugin, nativescriptWorkerLoaderStubPlugin } from '../helpers/workers.js';
@@ -45,6 +45,7 @@ import { normalizeModuleId } from '../helpers/normalize-id.js';
4545
import { getHmrWatchIgnoreGlobs } from '../helpers/hmr-scope.js';
4646
import { NS_OPTIMIZE_DEPS_EXCLUDE } from '../helpers/optimize-deps.js';
4747
import { sbgClassNamesPlugin } from '../helpers/sbg-class-names.js';
48+
import { chunkFileNames } from '../helpers/chunk-file-names.js';
4849
const require = createRequire(import.meta.url);
4950
// Optional PostCSS import plugin (only used if available)
5051
// Try to load postcss-import to control CSS @import resolution simply
@@ -509,13 +510,14 @@ export const baseConfig = ({ mode, flavor }: { mode: string; flavor?: string }):
509510
// though the file is right there on disk.
510511
//
511512
// Detect the real workspace root once at config time and
512-
// add it to `fs.allow`. `mergeConfig` concatenates arrays,
513-
// so apps that pass their own `server.fs.allow` keep
514-
// their entries on top of this baseline.
513+
// add it to `fs.allow`, alongside the workspace roots of any
514+
// linked dependency checkouts whose files the dev server must
515+
// serve. `mergeConfig` concatenates arrays, so apps that pass
516+
// their own `server.fs.allow` keep their entries on top of
517+
// this baseline.
515518
...(() => {
516-
const monorepoRoot = findMonorepoWorkspaceRoot(projectRoot);
517-
if (!monorepoRoot || monorepoRoot === projectRoot) return {};
518-
return { fs: { allow: [monorepoRoot, projectRoot] } };
519+
const allow = getDevServerFsAllow(projectRoot);
520+
return allow.length ? { fs: { allow } } : {};
519521
})(),
520522
}
521523
: {},
@@ -614,14 +616,7 @@ export const baseConfig = ({ mode, flavor }: { mode: string; flavor?: string }):
614616
// Chrome DevTools can fetch them even though the running code comes
615617
// from file:///app on the simulator/device.
616618
sourcemapBaseUrl: pathToFileURL(path.resolve(projectRoot, distOutputFolder)).toString() + '/',
617-
chunkFileNames: (chunk) => {
618-
if (chunk.name === 'vendor') return 'vendor.mjs';
619-
// Place worker files at root level, not in assets/
620-
if (chunk.name && chunk.name.includes('worker')) {
621-
return '[name]-[hash].js';
622-
}
623-
return '[name]-[hash].mjs';
624-
},
619+
chunkFileNames,
625620
assetFileNames: 'assets/[name][extname]',
626621
// Create single vendor chunk for most third-party modules.
627622
// Keep critical NativeScript core bootstrap/lifecycle modules in the main bundle
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import fs from 'fs';
2+
import os from 'os';
3+
import path from 'path';
4+
import { build } from 'vite';
5+
import { afterAll, describe, expect, it } from 'vitest';
6+
7+
import { chunkFileNames } from './chunk-file-names.js';
8+
9+
describe('chunkFileNames', () => {
10+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'ns-chunk-names-'));
11+
afterAll(() => fs.rmSync(root, { recursive: true, force: true }));
12+
13+
const buildFileNames = async (activitySource: string): Promise<string[]> => {
14+
fs.mkdirSync(path.join(root, 'ui/frame'), { recursive: true });
15+
fs.writeFileSync(path.join(root, 'ui/frame/activity.android.js'), activitySource);
16+
fs.writeFileSync(path.join(root, 'entry.js'), "import('./ui/frame/activity.android.js');\n");
17+
const result: any = await build({
18+
root,
19+
configFile: false,
20+
logLevel: 'silent',
21+
build: {
22+
write: false,
23+
minify: false,
24+
rolldownOptions: { input: path.join(root, 'entry.js'), output: { format: 'es', entryFileNames: 'bundle.mjs', chunkFileNames } },
25+
},
26+
});
27+
return (Array.isArray(result) ? result[0] : result).output.map((file: any) => file.fileName).sort();
28+
};
29+
30+
it('names the Android activity chunk without a hash, so a rebuild keeps the path the generated Java activity loads', async () => {
31+
expect(await buildFileNames('globalThis.activity = 1;\n')).toEqual(['activity.android.mjs', 'bundle.mjs']);
32+
expect(await buildFileNames('globalThis.activity = 2;\n')).toEqual(['activity.android.mjs', 'bundle.mjs']);
33+
});
34+
35+
it('keeps the vendor, worker and hashed names for other chunks', () => {
36+
expect(chunkFileNames({ name: 'vendor' })).toBe('vendor.mjs');
37+
expect(chunkFileNames({ name: 'image-worker' })).toBe('[name]-[hash].js');
38+
expect(chunkFileNames({ name: 'page' })).toBe('[name]-[hash].mjs');
39+
});
40+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export function chunkFileNames(chunk: { name?: string }): string {
2+
if (chunk.name === 'vendor') return 'vendor.mjs';
3+
if (chunk.name?.startsWith('activity.android')) return '[name].mjs';
4+
// Place worker files at root level, not in assets/
5+
if (chunk.name && chunk.name.includes('worker')) {
6+
return '[name]-[hash].js';
7+
}
8+
return '[name]-[hash].mjs';
9+
}

0 commit comments

Comments
 (0)