Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transclude inefficiency #7647

Merged
merged 9 commits into from
Jul 30, 2023
Merged

Fix transclude inefficiency #7647

merged 9 commits into from
Jul 30, 2023

Conversation

Jermolene
Copy link
Member

Fixes #7592

@vercel
Copy link

vercel bot commented Jul 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
tiddlywiki5 ✅ Ready (Inspect) Visit Preview Jul 30, 2023 5:04pm

// "text/plain" is the plain text result of wikifying the text
target = this.parseTransclusionTarget();
this.sourceText = target.text;
this.parserType = target.type;
Copy link
Member

Choose a reason for hiding this comment

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

The 2 lines above seem to be the same code for all 3 states. They may be moved above the switch statement. Or is it intended to be that way?

Copy link
Member

Choose a reason for hiding this comment

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

I think this.parseAsInline should also initialized and moved outside the cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

The 2 lines above seem to be the same code for all 3 states. They may be moved above the switch statement. Or is it intended to be that way?

Yes that can be made a bit more efficient.

I think this.parseAsInline should also initialized and moved outside the cases.

I don't think so. It is not required on all code paths

target = this.parseTransclusionTarget(parseAsInline);
this.sourceText = target.text;
this.parserType = target.type;
this.parseAsInline = target.parseAsInline;
Copy link
Member

Choose a reason for hiding this comment

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

It seems this.parseAsInline is only initialized if this case has been executed. Is that intentional? IMO undefined means "we do not know". The variable parseAsInline is defined as true or false. Just a gut feeling.

Copy link
Member Author

Choose a reason for hiding this comment

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

The code relies on this.parseAsInline defaulting to false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Export all on tiddlywiki.com 5.3.0 hangs the browser
2 participants