Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sveltejs/language-tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: svelte-check-3.6.8
Choose a base ref
...
head repository: sveltejs/language-tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: svelte-check-3.6.9
Choose a head ref
  • 4 commits
  • 8 files changed
  • 3 contributors

Commits on Mar 20, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fcff44f View commit details

Commits on Mar 23, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4abe9b3 View commit details

Commits on Apr 1, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3ea9c01 View commit details
  2. fix: ensure type widening for bind:group

    dummdidumm committed Apr 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    66e81f3 View commit details
14 changes: 13 additions & 1 deletion packages/language-server/src/importPackage.ts
Original file line number Diff line number Diff line change
@@ -58,7 +58,19 @@ export function importSvelte(fromPath: string): typeof svelte {
const pkg = getPackageInfo('svelte', fromPath);
const main = resolve(pkg.path, 'compiler');
Logger.debug('Using Svelte v' + pkg.version.full, 'from', main);
return dynamicRequire(main + (pkg.version.major >= 4 ? '.cjs' : ''));
if (pkg.version.major === 4) {
return dynamicRequire(main + '.cjs');
} else if (pkg.version.major === 5) {
// TODO remove once Svelte 5 is released
// (we switched from compiler.cjs to compiler/index.js at some point)
try {
return dynamicRequire(main);
} catch (e) {
return dynamicRequire(main + '.cjs');
}
} else {
return dynamicRequire(main);
}
}

export function importSveltePreprocess(fromPath: string): typeof sveltePreprocess {
Original file line number Diff line number Diff line change
@@ -64,8 +64,11 @@ class ModuleResolutionCache {
const fileNameWithoutEnding =
getLastPartOfPath(this.getCanonicalFileName(path)).split('.').shift() || '';
this.cache.forEach((val, key) => {
if (val) {
return;
}
const [containingFile, moduleName = ''] = key.split(CACHE_KEY_SEPARATOR);
if (!val && moduleName.includes(fileNameWithoutEnding)) {
if (moduleName.includes(fileNameWithoutEnding)) {
this.cache.delete(key);
this.pendingInvalidations.add(containingFile);
}
8 changes: 6 additions & 2 deletions packages/svelte2tsx/src/htmlxtojsx_v2/nodes/Binding.ts
Original file line number Diff line number Diff line change
@@ -59,9 +59,13 @@ export function handleBinding(
): void {
// bind group on input
if (element instanceof Element && attr.name == 'group' && parent.name == 'input') {
// add reassignment to force TS to widen the type of the declaration (in case it's never reassigned anywhere else)
const expressionStr = str.original.substring(
attr.expression.start,
getEnd(attr.expression)
);
element.appendToStartEnd([
rangeWithTrailingPropertyAccess(str.original, attr.expression),
';'
surroundWithIgnoreComments(`() => ${expressionStr} = __sveltets_2_any(null);`)
]);
return;
}
1 change: 1 addition & 0 deletions packages/svelte2tsx/svelte-shims-v4.d.ts
Original file line number Diff line number Diff line change
@@ -149,6 +149,7 @@ declare function __sveltets_2_cssProp(prop: Record<string, any>): {};
declare function __sveltets_2_ensureSnippet(val: ReturnType<import('svelte').Snippet> | undefined | null): any;
// @ts-ignore Svelte v3/v4 don't have this
declare function __sveltets_2_snippet(): import('svelte').Snippet;
// @ts-ignore Svelte v3/v4 don't have this
declare function __sveltets_2_snippet<T>(t: T): import('svelte').Snippet<[T]>;

/** @internal PRIVATE API, DO NOT USE */

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///<reference types="svelte" />
;function render() {
async () => { { svelteHTML.createElement("input", { "id":`dom-input`,"type":`radio`,"value":`dom`,});$compile_options.generate;}};
async () => { { svelteHTML.createElement("input", { "id":`dom-input`,"type":`radio`,"value":`dom`,});/*Ωignore_startΩ*/() => $compile_options.generate = __sveltets_2_any(null);/*Ωignore_endΩ*/}};
return { props: /** @type {Record<string, never>} */ ({}), slots: {}, events: {} }}

export default class Input__SvelteComponent_ extends __sveltets_2_createSvelte2TsxComponent(__sveltets_2_partial(__sveltets_2_with_any_event(render()))) {