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

Add wikify operator #8730

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add wikify operator #8730

wants to merge 1 commit into from

Conversation

Jermolene
Copy link
Member

This PR adds a "wikify" operator that has the same functionality as the wikify widget. I regard this as quite controversial because while it unlocks some important capabilities, it also suffers from performance issues and invites users to adopt patterns that can be dangerous:

  • The performance issues arise from the fact that the wikify operator does not allow us to use the usual mechanism for caching parsed tiddlers. This means that to evaluate the operator always requires a full parse of the input text as well as the construction of a widget tree (which would always be required, even if caching were to be implemented somehow)
  • The issue with dangerous patterns is that users might be tempted to replace complex filters with a wikitext equivalent, for example using the <$list> widget to generate a set of numbers instead of the [range[]] operator. Besides being horribly inefficient, there are pitfalls with unexpected wikification

This PR is cherry picked from #8702; I plan to refactor the work there to not require the wikify operator because of the performance issues.

The question now is what are the use cases for the wikify operator, and are there any other ways to accomplish those use cases?

Copy link

github-actions bot commented Nov 7, 2024

Confirmed: Jermolene has already signed the Contributor License Agreement (see contributing.md)

Copy link

netlify bot commented Nov 7, 2024

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 55cf0b2
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/672ceaf559d3f800081fab88
😎 Deploy Preview https://deploy-preview-8730--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Jermolene Jermolene mentioned this pull request Nov 7, 2024
8 tasks
@Leilei332
Copy link
Contributor

Leilei332 commented Nov 7, 2024

When updating the flexoki palette, I found that the tag won't display properly unless index background, foreground and tag-background 's value is hardcoded. So the wikify operator should be used in the tag macro.

But we had better not use it at present since tag pill is often used in UI, which may cause performance issues.

@Jermolene
Copy link
Member Author

When updating the flexoki palette, I found that the tag won't display properly unless index background, foreground and tag-background 's value is hardcoded. So the wikify operator should be used in the tag macro.

Ouch. I suspect that the compiled palette idea under investigation in #8702 will resolve a number of issues like this, and ultimately should allow us to significantly improve the stylesheet refresh performance.

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.

2 participants