Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
38ab648
chore(ci): use GitHub Actions for cross-platform tests, not SuaceLabs
wjhsf Oct 20, 2025
4cee108
wjhsf Oct 20, 2025
1480d07
chore: not a template string
wjhsf Oct 20, 2025
0c5f68e
test(integration): disable flaky tests (temporarily)
wjhsf Oct 21, 2025
209e9fb
chore(integration-tests): remove leading `test-` from filenames
wjhsf Oct 20, 2025
a91f183
chore(integration-tests): `delegate-focus-` -> `delegates-focus-`
wjhsf Oct 20, 2025
e93eb75
chore(integration-tests): rename `tab-index-` to `tabindex-`
wjhsf Oct 21, 2025
42c33b2
chore(integration-tests): remove `-elements`
wjhsf Oct 21, 2025
fe526cc
chore(integration-tests): rename `previous-` to `prev-`
wjhsf Oct 21, 2025
fb43b7f
test(integration-tests): await async method
wjhsf Oct 21, 2025
7608c1f
chore(integration-tests): fully remove `test-` prefix
wjhsf Oct 21, 2025
12d5791
test(integration-tests): derive test names instead of hard-coding
wjhsf Oct 21, 2025
6cc010d
chore(integration-tests): rename way-too-long test name
wjhsf Oct 21, 2025
8ac4b34
Merge branch 'wjh/rename-integration-tests' into wjh/no-saucelabs
wjhsf Oct 21, 2025
4c0683f
chore(ci): attempt to run bash on windows
wjhsf Oct 21, 2025
a041012
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 22, 2025
4c195f9
chore(ci): declare env vars in more cross-platform manner
wjhsf Oct 22, 2025
9f91ecc
chore(ci): run yarn install in bash
wjhsf Oct 22, 2025
2ded948
chore(ci): give up and use cross-env
wjhsf Oct 22, 2025
addf3d3
chore(ci): try without `exec`
wjhsf Oct 22, 2025
cdfff7b
test(wtr): change variable name
wjhsf Oct 22, 2025
97f1ae6
chore(ci): remove saucelabs
wjhsf Oct 22, 2025
d064807
test(ci): run unit tests on windows
wjhsf Oct 22, 2025
3660a90
chore(ci): why different?
wjhsf Oct 22, 2025
9c92961
chore(ci): avoid unnecessasry rebuild
wjhsf Oct 22, 2025
e4279e3
chore(ci): windows compat
wjhsf Oct 22, 2025
7f1d77f
Revert "chore(ci): windows compat"
wjhsf Oct 22, 2025
50c93d3
chore(ci): windows compat
wjhsf Oct 22, 2025
f224212
chore(ci): update actions versions
wjhsf Oct 22, 2025
ac0951e
chore(ci): install chromedriver as part of setup-chrome
wjhsf Oct 22, 2025
6ca5084
chore(ci): more sloppy windows compat
wjhsf Oct 22, 2025
abe94ea
chore(ci): more windowsy
wjhsf Oct 22, 2025
d993c2a
chore: add package manager
wjhsf Oct 22, 2025
f525f21
chore(ci): more windowsy
wjhsf Oct 22, 2025
38fab00
chore(ci): more windowsy
wjhsf Oct 22, 2025
45b62a0
chore(ci): more windowsy
wjhsf Oct 22, 2025
0b505ca
chore(ci): crlf smh
wjhsf Oct 23, 2025
df1c800
chore(ci): revert setup-chrome@v2
wjhsf Oct 23, 2025
9a6ceee
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 23, 2025
79198cd
chore: include call stack
wjhsf Oct 23, 2025
c8b1e05
chore: debug
wjhsf Oct 23, 2025
95d1a00
chore: actually, nvm
wjhsf Oct 23, 2025
53e368f
test(wtr): jsdoc for the doc gods
wjhsf Oct 23, 2025
59e17e8
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 23, 2025
e42d6b8
chore(ci): update input descriptions
wjhsf Oct 23, 2025
ba0ec64
chore: revert unrelated changes
wjhsf Oct 23, 2025
9146836
chore: more windowsy
wjhsf Oct 23, 2025
a3c017f
chore: revert unrelated changes
wjhsf Oct 23, 2025
efc5a10
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 23, 2025
2ec81ee
test(wtr): disable tests broken on windows
wjhsf Oct 23, 2025
57a6e60
revert: just log text
wjhsf Oct 23, 2025
e7fc506
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 23, 2025
232b563
chore(ci): remove unnecessary env var
wjhsf Oct 23, 2025
b7bf6bd
chore(ci): add names for clarity
wjhsf Oct 23, 2025
6f32328
chore: move `x` to `c`
wjhsf Oct 29, 2025
2608565
chore: update usage of `x` to `c`
wjhsf Oct 29, 2025
caeffdf
chore: update usage of `X-` to `C-`
wjhsf Oct 29, 2025
0a04861
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 29, 2025
6be5873
test(wtr): fix scope tokens
wjhsf Oct 29, 2025
cd0857a
test(wtr): order can be different
wjhsf Oct 29, 2025
a115ec2
test(wtr): try to normalize filenames
wjhsf Oct 29, 2025
729c5fa
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 30, 2025
5053702
chore: update yarn.lock
wjhsf Oct 30, 2025
3f26328
test(wtr): enable browser logs
wjhsf Oct 31, 2025
5528c8d
Merge branch 'master' into wjh/no-saucelabs
wjhsf Oct 31, 2025
fdfa467
test(wtr): filter out [WDIO] logs
wjhsf Oct 31, 2025
caf3b0b
test(wtr): try to fix windows
wjhsf Oct 31, 2025
680e406
test(wtr): no browser logs
wjhsf Nov 3, 2025
4f1181c
test(wtr): test objects in matrix
wjhsf Nov 3, 2025
2fe5261
Revert "test(wtr): test objects in matrix"
wjhsf Nov 4, 2025
afb89ce
chore(ci): split jobs to make faster, maybe
wjhsf Nov 4, 2025
e0bac7b
Merge branch 'master' into wjh/no-saucelabs
wjhsf Nov 4, 2025
4c5c4ec
Merge branch 'master' into wjh/no-saucelabs
wjhsf Nov 5, 2025
946e8a4
chore(ci): fail-fast: false
wjhsf Nov 5, 2025
f14b50f
chore(ci): merge jobs
wjhsf Nov 5, 2025
69e235d
chore(ci): merge more jobs
wjhsf Nov 5, 2025
ac73e88
chore(ci): reconfigure so it hopefully works
wjhsf Nov 5, 2025
8656350
Merge branch 'master' into wjh/no-saucelabs
wjhsf Nov 5, 2025
6b88b81
chore(ci): consolidate hydration tests
wjhsf Nov 5, 2025
1381c1d
chore(ci): exclude engine-server flag + SSR v2 runtime combo
wjhsf Nov 5, 2025
811eee2
chore(ci): add default env hydration tests
wjhsf Nov 5, 2025
f7896c0
chore(ci): use correct SSR package for hydration tests
wjhsf Nov 5, 2025
cb47c4a
chore(ci): give up on windows
wjhsf Nov 5, 2025
4b5a22c
chore(ci): give up on windows
wjhsf Nov 5, 2025
22158dc
Revert "chore: move `x` to `c`"
wjhsf Nov 5, 2025
635a915
test(wtr): revert usage of `c` to `x`
wjhsf Nov 5, 2025
65bdde6
Apply suggestion from @wjhsf
wjhsf Nov 5, 2025
38ab16d
test(wtr): revert `c-` to `x-`
wjhsf Nov 5, 2025
df109a7
test(wtr): revert scope tokens
wjhsf Nov 5, 2025
14ca621
test(wtr): re-enable tests that only fail on windows
wjhsf Nov 5, 2025
91a2d8e
chore(ci): revert CI changes
wjhsf Nov 5, 2025
eaff414
chore: restore saucelabs dep
wjhsf Nov 5, 2025
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"printWidth": 100,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "es5"
"trailingComma": "es5",
"endOfLine": "lf"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@
"http-cache-semantics": "4.2.0",
"@types/estree": "^1.0.8"
},
"dependencies": {}
"dependencies": {},
"packageManager": "yarn@1.22.22"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const LWC_SSR = readFileSync(
'utf8'
);

const ROOT_DIR = path.join(import.meta.dirname, '../..');
const ROOT_DIR = path.join(import.meta.dirname, '..', '..');
const COMPONENT_NAME = 'x-main';
const COMPONENT_ENTRYPOINT = 'x/main/main.js';

Expand All @@ -25,7 +25,9 @@ async function compileModule(input, targetSSR, format) {
targetSSR,
modules: [{ dir: modulesDir }],
experimentalDynamicComponent: {
loader: fileURLToPath(new URL('../../helpers/loader.js', import.meta.url)),
loader: fileURLToPath(
new URL('../../helpers/loader.js', import.meta.url)
).replaceAll(path.sep, path.posix.sep),
strict: true,
},
enableSyntheticElementInternals: true,
Expand Down Expand Up @@ -108,8 +110,8 @@ async function getSsrMarkup(componentEntrypoint, configPath) {
* This function wraps those configs in the test code to be executed.
*/
async function wrapHydrationTest(configPath) {
const suiteDir = path.dirname(configPath);
const componentEntrypoint = path.join(suiteDir, COMPONENT_ENTRYPOINT);
const suiteDir = path.posix.dirname(configPath);
const componentEntrypoint = path.posix.join(suiteDir, COMPONENT_ENTRYPOINT);
const ssrOutput = await getSsrMarkup(componentEntrypoint, configPath);

return `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { spyOn } from '@vitest/spy';
import * as LWC from 'lwc';
import { setHooks } from '../../helpers/hooks';
import { resetDOM, resetAlreadyLoggedMessages } from '../../helpers/reset';

/*
* Because these tests are written in JS, the type defs below are not enforced. They are provided
Expand Down Expand Up @@ -132,6 +133,9 @@ export function runTest(configPath, componentPath, ssrRendered) {

afterEach(() => {
consoleSpy.reset();
// in case of retries
resetDOM();
resetAlreadyLoggedMessages();
});

afterAll(() => {
Expand Down
19 changes: 10 additions & 9 deletions packages/@lwc/rollup-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export interface RollupLwcOptions {

const PLUGIN_NAME = 'rollup-plugin-lwc-compiler';

const IMPLICIT_DEFAULT_HTML_PATH = '@lwc/resources/empty_html.js';
const IMPLICIT_DEFAULT_HTML_PATH = ['@lwc', 'resources', 'empty_html.js'].join(path.sep);
const EMPTY_IMPLICIT_HTML_CONTENT = 'export default void 0';
const IMPLICIT_DEFAULT_CSS_PATH = '@lwc/resources/empty_css.css';
const IMPLICIT_DEFAULT_CSS_PATH = ['@lwc', 'resources', 'empty_css.css'].join(path.sep);
const EMPTY_IMPLICIT_CSS_CONTENT = '';
const SCRIPT_FILE_EXTENSIONS = ['.js', '.mjs', '.jsx', '.ts', '.mts', '.tsx'];

Expand Down Expand Up @@ -352,18 +352,19 @@ export default function lwc(pluginOptions: RollupLwcOptions = {}): Plugin {
// Specifier will only exist for modules with alias paths.
// Otherwise, use the file directory structure to resolve namespace and name.
const [namespace, name] =
// Note we do not need to use path.sep here because this filename contains
// a '/' regardless of Windows vs Unix, since it comes from the Rollup `id`
specifier?.split('/') ?? path.dirname(filename).split('/').slice(-2);
specifier?.split('/') ?? path.dirname(filename).split(path.sep).slice(-2);

/* v8 ignore next */
if (!namespace || !name) {
// TODO [#4824]: Make this an error rather than a warning
this.warn(
'The component namespace and name could not be determined from the specifier ' +
JSON.stringify(specifier) +
' or filename ' +
JSON.stringify(filename)
`The component namespace and name (${JSON.stringify(
namespace
)} and ${JSON.stringify(
name
)}) could not be determined from the specifier ${JSON.stringify(
specifier
)} or filename ${JSON.stringify(path.dirname(filename))}`
);
}

Expand Down
3 changes: 2 additions & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"description": "Playground project to experiment with LWC.",
"scripts": {
"dev": "rollup -c --watch",
"build": "NODE_ENV=production rollup -c"
"build": "cross-env NODE_ENV=production rollup -c"
},
"devDependencies": {
"@lwc/rollup-plugin": "8.24.0",
"@rollup/plugin-replace": "^6.0.3",
"@rollup/plugin-typescript": "^12.3.0",
"cross-env": "^10.1.0",
"lwc": "8.24.0",
"rollup": "^4.52.5",
"rollup-plugin-livereload": "^2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion scripts/tasks/check-and-rewrite-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const expectedPkgJsons = [];

for (const dir of globSync('./packages/@lwc/*')) {
const filename = path.join('./', dir, 'package.json');
const actual = fs.readFileSync(filename, 'utf-8');
const actual = fs.readFileSync(filename, 'utf-8').replace(/\r\n/g, '\n'); // Windows compat
const pkg = JSON.parse(actual);
// Skip private packages
if (pkg.private) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/tasks/generate-license-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const formattedLicense = await prettier.format(newLicense, {

// Check against current top-level license for changes
const shouldWarnChanges =
process.argv.includes('--test') && formattedLicense !== (await readFile('LICENSE.md', 'utf-8'));
process.argv.includes('--test') &&
formattedLicense !== (await readFile('LICENSE.md', 'utf-8')).replace(/\r\n/g, '\n');

// Top level license
await writeFile('LICENSE.md', formattedLicense, 'utf-8');
Expand Down
31 changes: 11 additions & 20 deletions scripts/tasks/verify-treeshakable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@
*/

// Inspired from: https://github.com/Rich-Harris/agadoo
import path from 'node:path';
import { rollup } from 'rollup';
import pluginVirtual from '../rollup/plugin-virtual.mjs';

async function check(input) {
const resolved = path.resolve(input);

// Tell rollup to bundle a fake file whose content is just `import "path from CLI arg"`
// If the imported file is tree-shakeable (pure imports/exports, no side effects),
// then the bundled code will be an empty file
const bundle = await rollup({
input: '__virtual__',
plugins: [pluginVirtual(`import "${resolved}";`)],
plugins: [pluginVirtual(`import "${input}";`)],
onwarn: (warning, handle) => {
if (warning.code !== 'EMPTY_BUNDLE') handle(warning);
},
Expand All @@ -28,26 +25,20 @@ async function check(input) {
format: 'esm',
});

const [chunk] = res.output;
const [{ code }] = res.output;

return {
code: chunk.code,
isTreeShakable: chunk.code.trim().length === 0,
code,
isTreeShakable: code.trim().length === 0,
};
}

const input = process.argv[2];
check(input)
.then((res) => {
if (res.isTreeShakable === false) {
console.error(
`${res.code}\n❗️ Failed to fully treeshake ${input}; see remaining code above.`
);
}
const result = await check(input);
if (!result.isTreeShakable) {
console.error(
`${result.code}\n❗️ Failed to fully treeshake ${input}; see remaining code above.`
);
}

process.exit(res.isTreeShakable ? 0 : 1);
})
.catch((err) => {
console.error(err);
process.exit(1);
});
Comment on lines -50 to -53

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this removed b/c it's redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Changing to a top-level await accomplishes the same thing.

process.exitCode = result.isTreeShakable ? 0 : 1;
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,11 @@
dependencies:
tslib "^2.4.0"

"@epic-web/invariant@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@epic-web/invariant/-/invariant-1.0.0.tgz#1073e5dee6dd540410784990eb73e4acd25c9813"
integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==

"@esbuild/aix-ppc64@0.25.12":
version "0.25.12"
resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz#80fcbe36130e58b7670511e888b8e88a259ed76c"
Expand Down Expand Up @@ -5432,6 +5437,14 @@ create-wdio@9.18.2:
type-fest "^4.41.0"
yargs "^17.7.2"

cross-env@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-10.1.0.tgz#cfd2a6200df9ed75bfb9cb3d7ce609c13ea21783"
integrity sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==
dependencies:
"@epic-web/invariant" "^1.0.0"
cross-spawn "^7.0.6"

cross-fetch@3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
Expand Down