Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/svelte2tsx/src/htmlxtojsx/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Node } from 'estree-walker';
import MagicString from 'magic-string';
import svelte from 'svelte/compiler';
import { walk } from 'svelte/compiler';
import { parseHtmlx } from '../utils/htmlxparser';
import { getSlotName } from '../utils/svelteAst';
import { handleActionDirective } from './nodes/action-directive';
Expand Down Expand Up @@ -55,7 +55,7 @@ export function convertHtmlxToJsx(

let ifScope = new IfScope(templateScopeManager);

(svelte as any).walk(ast, {
(walk as any)(ast, {
enter: (node: Node, parent: Node, prop: string, index: number) => {
try {
switch (node.type) {
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte2tsx/src/utils/htmlxparser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import compiler from 'svelte/compiler';
import { parse } from 'svelte/compiler';
import { Node } from 'estree-walker';

function parseAttributeValue(value: string): string {
Expand Down Expand Up @@ -106,7 +106,7 @@ export function parseHtmlx(htmlx: string, options?: { emitOnTemplateError?: bool
const parsingCode = options?.emitOnTemplateError
? blankPossiblyErrorOperatorOrPropertyAccess(deconstructed)
: deconstructed;
const svelteHtmlxAst = compiler.parse(parsingCode).html;
const svelteHtmlxAst = parse(parsingCode).html;

//restore our script and style tags as nodes to maintain validity with HTMLx
for (const s of verbatimElements) {
Expand Down