Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 10 additions & 168 deletions V5_PLANNING.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@changesets/cli": "^2.31.0",
"@types/node": "^24.12.4",
"cspell": "^9.8.0",
"knip": "^6.14.1",
"knip": "^6.14.2",
"oxfmt": "^0.42.0",
"oxlint": "^1.66.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@stencil/dev-server": "workspace:*",
"prompts": "^2.4.2"
"prompts": "^2.0.0"
},
"devDependencies": {
"@stencil/core": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/migrations/_test_/hash-file-names.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('hashFileNamesRule', () => {
});
});

describe('transform single-line output target', () => {
describe('transform single-line output target', () => {
it('injects hashFileNames into single-line loader-bundle', () => {
const result = transform(`export const config = {
hashFileNames: false,
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('hashFileNamesRule', () => {
});
});

describe('transform multi-line output target', () => {
describe('transform multi-line output target', () => {
it('injects hashFileNames into multi-line loader-bundle on its own line', () => {
const result = transform(`export const config = {
hashFileNames: false,
Expand Down Expand Up @@ -126,7 +126,7 @@ describe('hashFileNamesRule', () => {
});
});

describe('transform edge cases', () => {
describe('transform edge cases', () => {
it('removes top-level prop even when no matching output targets exist', () => {
const result = transform(`export const config = {
hashFileNames: false,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/migrations/rules/external-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const externalRuntimeRule: MigrationRule = {
id: 'external-runtime',
name: 'externalRuntime Default Change',
description:
"Remove redundant 'externalRuntime: false' from standalone output targets false is now the default",
"Remove redundant 'externalRuntime: false' from standalone output targets false is now the default",
fromVersion: '4.x',
toVersion: '5.x',

Expand Down Expand Up @@ -40,7 +40,7 @@ export const externalRuntimeRule: MigrationRule = {
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
matches.push({
node,
message: "'externalRuntime: false' is now the default this property can be removed",
message: "'externalRuntime: false' is now the default this property can be removed",
line: line + 1,
column: character + 1,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/migrations/rules/hash-file-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const hashFileNamesRule: MigrationRule = {
ts.isIdentifier(node.name) &&
(node.name.text === 'hashFileNames' || node.name.text === 'hashedFileNameLength')
) {
// Only match at top-level config skip if inside an output target object
// Only match at top-level config skip if inside an output target object
// (output targets always have a sibling `type` property)
const parent = node.parent;
if (ts.isObjectLiteralExpression(parent)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/migrations/rules/light-dom-patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const lightDomPatchesRule: MigrationRule = {
// Explicit opt-out
replacement = 'lightDomPatches: false';
} else if (experimentalValue === true && hasIndividualKeys) {
// experimentalSlotFixes: true overrides individual flags treat as all-on
// experimentalSlotFixes: true overrides individual flags treat as all-on
replacement = null; // new default covers this
} else {
// Individual flags only (no experimentalSlotFixes, or unknown value)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/migrations/rules/rolldown-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const rolldownConfigRule: MigrationRule = {
message:
name === 'rollupConfig'
? `'rollupConfig' renamed to 'rolldownConfig'; 'inputOptions' wrapper removed`
: `'rolldownConfig.inputOptions' wrapper removed options are now top-level`,
: `'rolldownConfig.inputOptions' wrapper removed options are now top-level`,
line: line + 1,
column: character + 1,
});
Expand Down Expand Up @@ -178,7 +178,7 @@ export const rolldownConfigRule: MigrationRule = {
);

if (!inputOptionsProp) {
// No inputOptions to flatten just rename the key if needed
// No inputOptions to flatten just rename the key if needed
if (name === 'rollupConfig') {
const nameStart = node.name.getStart(sourceFile);
edits.push({
Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,27 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@parcel/watcher": "^2.5.1",
"@preact/signals-core": "^1.14.2",
"@parcel/watcher": "^2.0.0",
"@preact/signals-core": "^1.0.0",
"@rollup/pluginutils": "^5.3.0",
"@stencil/cli": "workspace:*",
"@stencil/dev-server": "workspace:*",
"@stencil/mock-doc": "workspace:*",
"browserslist": "^4.0.0",
"chalk": "^5.6.2",
"chalk": "^5.0.0",
"css-what": "^7.0.0",
"jiti": "^2.0.0",
"lightningcss": "^1.0.0",
"magic-string": "^0.30.0",
"picomatch": "^4.0.3",
"picomatch": "^4.0.0",
"postcss": "^8.0.0",
"postcss-safe-parser": "^7.0.0",
"postcss-selector-parser": "^7.0.0",
"resolve": "^1.22.0",
"rolldown": "^1.0.0",
"semver": "^7.7.4",
"semver": "^7.0.0",
"terser": "^5.0.0",
"tinyglobby": "^0.2.15",
"tinyglobby": "^0.2.0",
"typescript": "catalog:"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/app-data/lazy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Import Env/NAMESPACE/BUILD from the external app-data (kept external in the lazy build,
// maps to @stencil/core/runtime/app-data in dist). Consumers alias that to their
// collection's app-data to get correct Env values and component-specific BUILD flags.
// We only override lazyLoad: true the one flag that must always be set for the lazy
// We only override lazyLoad: true the one flag that must always be set for the lazy
// runtime mechanism to work regardless of what the consumer's app-data provides.
import { BUILD as _BUILD, Env, NAMESPACE } from 'virtual:app-data-external';
import type { BuildConditionals } from '@stencil/core';
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/compiler/app-core/app-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const getModuleImports = (moduleMap: ModuleMap, filePath: string, importedModule
/**
* Config-driven extras flags that a collection lib author may have set explicitly.
* These are the only flags propagated from a collection's buildFlags into the consumer's
* build everything else is a component-derived flag that the consumer recomputes itself
* build everything else is a component-derived flag that the consumer recomputes itself
* by scanning all components (including those from the collection).
*/
const COLLECTION_CONFIG_FLAGS: ReadonlySet<keyof BuildConditionals> = new Set([
Expand All @@ -174,7 +174,7 @@ const COLLECTION_CONFIG_FLAGS: ReadonlySet<keyof BuildConditionals> = new Set([

/**
* Merge config-driven build flags from consumed collections into the active build conditionals.
* Only flags explicitly set via the lib author's stencil.config extras are merged component-
* Only flags explicitly set via the lib author's stencil.config extras are merged component-
* derived flags are excluded because the consumer recomputes them from source.
*
* **This function mutates the build conditionals argument**
Expand Down Expand Up @@ -222,7 +222,7 @@ export const updateBuildConditionals = (config: ValidatedConfig, b: BuildConditi
b.asyncLoading = !!(b.asyncLoading || b.lazyLoad || b.taskQueue || b.initializeNextTick);
b.cssAnnotations = true;
// lightDomPatches only matter when there are non-shadow slotted components.
// Gating here keeps shadow-only bundles lean patch functions get tree-shaken out.
// Gating here keeps shadow-only bundles lean patch functions get tree-shaken out.
const ldp = config.extras.lightDomPatches ?? true;
if (b.slotRelocation && ldp !== false) {
b.lightDomPatches = ldp === true;
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/compiler/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export const build = async (
tsTimeSpan.finish('transpile finished');
if (buildCtx.hasError) return buildAbort(buildCtx);

// If TS emitted nothing, the "script change" was a phantom duplicate event clear the flag
// If TS emitted nothing, the "script change" was a phantom duplicate event clear the flag
// so type validation and bundling are skipped.
if (buildCtx.isRebuild && buildCtx.hasScriptChanges && compilerCtx.changedModules.size === 0) {
buildCtx.hasScriptChanges = false;
}

// Skip type validation on rebuilds with no script changes the type graph is unchanged.
// Skip type validation on rebuilds with no script changes the type graph is unchanged.
const skipTypeValidation = buildCtx.isRebuild && !buildCtx.hasScriptChanges;

if (!skipTypeValidation) {
Expand All @@ -85,7 +85,7 @@ export const build = async (
// Return null so watch-build restarts with a fresh program.
return null;
}
// types changed but no restart needed components.d.ts is watch-ignored
// types changed but no restart needed components.d.ts is watch-ignored
// to prevent cascade rebuilds, so just continue with the current build.
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/compiler/build/watch-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const createWatchBuild = async (
// TS files that need cache invalidation before the next rebuild
const tsFilesToInvalidate = new Set<string>();

// Debounce timer multiple watchers can fire for the same change
// Debounce timer multiple watchers can fire for the same change
let rebuildTimeout: ReturnType<typeof setTimeout> | null = null;

// Suppress FSEvents double-events (the same save can fire twice ~200-500ms apart),
Expand Down Expand Up @@ -175,7 +175,7 @@ export const createWatchBuild = async (

/**
* Returns files as a prefixed list, or 'none' if empty.
* No space before the filename the logger wraps on whitespace.
* No space before the filename the logger wraps on whitespace.
* @param files the list of files to format for debug output
* @returns the formatted string for debug output
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/compiler/bundle/core-resolve-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const coreResolvePlugin = (
id === STENCIL_INTERNAL_LAZY_CLIENT_PLATFORM_ID
) {
if (externalRuntime) {
// not bundling the client runtime must be a custom elements or loader-bundle
// not bundling the client runtime must be a custom elements or loader-bundle
// build where the runtime is an external import rather than bundled
return { id, external: true };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const extTransformsPlugin = (
// Memoize the expensive SASS + Lightning CSS computation across output targets.
// customElements, lazy, and hydrate all process the same ~N stylesheets;
// caching here means only the first output target pays the full per-sheet
// cost subsequent targets hit the cache and complete in microseconds.
// cost subsequent targets hit the cache and complete in microseconds.
//
// NOTE: this cache is keyed by the raw annotated `id` which encodes the
// file path plus component metadata (tag, mode, encapsulation). Entries are
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/compiler/bundle/file-load-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const fileLoadPlugin = (fs: InMemoryFileSystem): Plugin => {
// Confirm paths that exist only in the in-memory FS so rolldown's native
// disk resolver doesn't reject virtual files before the load hook runs.
resolveId(id, importer) {
// Preserve query params (e.g. ?tag=cmp-a) strip only for FS lookup,
// Preserve query params (e.g. ?tag=cmp-a) strip only for FS lookup,
// then re-attach so extTransformsPlugin.transform can parse them.
const qIdx = id.indexOf('?');
const query = qIdx !== -1 ? id.slice(qIdx) : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('validateSsrWasmOutputTarget', () => {
const { config: validatedConfig } = validateConfig(config, mockLoadConfigInit());

const ssrWasm = validatedConfig.outputTargets.find(isOutputTargetSsrWasm);
// ssr-wasm has no external field everything is bundled into the binary
// ssr-wasm has no external field everything is bundled into the binary
expect((ssrWasm as any)?.external).toBeUndefined();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('validateRolldownConfig', () => {
config.rolldownConfig = {
external: ['foo', 'bar'],
treeshake: false,
// @ts-expect-error intentionally testing unknown key rejection
// @ts-expect-error intentionally testing unknown key rejection
notAnOption: {},
};
const rolldownConfig = validateRolldownConfig(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const validateWww = (
diagnostics: d.Diagnostic[],
userOutputs: d.OutputTarget[],
) => {
// Only count 'real' user-configured output targets exclude auto-generated
// Only count 'real' user-configured output targets exclude auto-generated
// outputs (types, collection, global-style, assets) that autoGenerateOutputs()
// may have injected into userOutputs before this function was called, so a bare config
// (no explicit output targets) still gets the default www output added.
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/compiler/config/validate-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export const validatePlugins = (config: d.UnvalidatedConfig, diagnostics: d.Diag

if (hasCommonjs) {
const warn = buildWarn(diagnostics);
warn.messageText = `Rolldown handles CommonJS natively remove the commonjs plugin from your "stencil.config.ts" plugins.`;
warn.messageText = `Rolldown handles CommonJS natively remove the commonjs plugin from your "stencil.config.ts" plugins.`;
}

if (hasResolveNode) {
const warn = buildWarn(diagnostics);
warn.messageText = `Rolldown handles module resolution natively remove the node-resolve plugin from your "stencil.config.ts" plugins. Use the "nodeResolve" config option to customise resolution.`;
warn.messageText = `Rolldown handles module resolution natively remove the node-resolve plugin from your "stencil.config.ts" plugins. Use the "nodeResolve" config option to customise resolution.`;
}

config.rolldownPlugins.before = [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/compiler/fs-watch/fs-watch-rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const isWatchIgnorePath = (config: d.ValidatedConfig, path: string) => {
}
const outputTargets = config.outputTargets;
const ignoreFiles = [
// Ignore components.d.ts its disk write would cascade-rebuild all components.
// Ignore components.d.ts its disk write would cascade-rebuild all components.
getComponentsDtsSrcFilePath(config),
...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.file),
...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.typesFile),
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/compiler/optimize/autoprefixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const autoprefixCss = async (

/**
* Default browserslist targets used when autoprefixing CSS in v5.
* Targets modern browsers IE11, old Edge, and very old mobile browsers
* Targets modern browsers IE11, old Edge, and very old mobile browsers
* are no longer included since Stencil v5 targets ES2017+ only.
*/
const DEFAULT_BROWSER_TARGETS: string[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('outputTarget, www / loader-bundle', () => {
path.join(root, 'custom-dist', 'cjs'),
]);

// default www/ must not exist only custom-www/ should
// default www/ must not exist only custom-www/ should
expectFilesDoNotExist(compiler.fs, [
path.join(root, 'www'),
// custom-www with default index.html must not exist (custom indexHtml is custom-index.htm)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const writeCollectionOutput = async (
};

const generateAppDataModule = (build: d.BuildConditionals, config: d.ValidatedConfig): string => {
// JSON.stringify omits undefined fields missing flags are treated as false by the runtime.
// JSON.stringify omits undefined fields missing flags are treated as false by the runtime.
const buildStr = JSON.stringify(build, null, 2);
const envStr = JSON.stringify(config.env ?? {});
const ns = JSON.stringify(config.fsNamespace);
Expand Down Expand Up @@ -167,7 +167,7 @@ const serializeCollectionManifest = (
buildFlags.initializeNextTick = !!config.extras?.initializeNextTick;
buildFlags.asyncQueue = config.taskQueue === 'congestionAsync';

// Hydration marker consumers must know which selector the lib used so @stencil/vitest
// Hydration marker consumers must know which selector the lib used so @stencil/vitest
// and other tooling can detect when components are ready. Defaults to class-based.
if (config.hydratedFlag) {
buildFlags.hydratedAttribute = config.hydratedFlag.selector === 'attribute';
Expand All @@ -178,9 +178,9 @@ const serializeCollectionManifest = (
}
buildFlags.invisiblePrehydration =
typeof config.invisiblePrehydration === 'undefined' ? true : config.invisiblePrehydration;
// constructableCSS is only false during HMR dev mode always true in distributed output
// constructableCSS is only false during HMR dev mode always true in distributed output
buildFlags.constructableCSS = true;
// cssAnnotations gates addHydratedFlag (asyncLoading && cssAnnotations) always true
// cssAnnotations gates addHydratedFlag (asyncLoading && cssAnnotations) always true
buildFlags.cssAnnotations = true;

// create the single collection we're going to fill up with data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const outputLazy = async (
break;
}
} catch {
// file not readable yet will be caught properly during actual style build
// file not readable yet will be caught properly during actual style build
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/compiler/output-targets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const generateOutputTargets = async (

invalidateRolldownCaches(compilerCtx);

// Skip bundler outputs on rebuilds where only HTML/assets changed output would be identical.
// Skip bundler outputs on rebuilds where only HTML/assets changed output would be identical.
const needsBundlerRebuild =
!buildCtx.isRebuild || buildCtx.hasScriptChanges || buildCtx.hasStyleChanges;

Expand Down
Loading
Loading