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

View Widget View handler #8135

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

BurningTreeC
Copy link
Contributor

@BurningTreeC BurningTreeC commented Apr 6, 2024

This PR adds a ViewHandler base class to the view widget and subclasses for each of the different views

The ViewHandler has methods render, renderWikified, createTextNode, createWikifiedTextNode, createFakeWidget and refresh - EDIT: and now also refreshWikified
These methods are used by more than one of the different subclasses.

The subclasses are initialised if they're needed.
There's still a big switch statement in the ViewWidget's getView method to find the view and initialise the correct subclass, maybe there's a better method to do so but I haven't found one.

Each subclass has its own getValue method.
The wikified views also have dedicated render and refresh methods.

I hope I got this right this time 😸

Please review and test and leave me some comments if this is the right approach and what could be simplified.
I had to read about subclassing for this and am not 100% sure if I got it right.

Copy link

vercel bot commented Apr 6, 2024

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

Name Status Preview Updated (UTC)
tiddlywiki5 ✅ Ready (Inspect) Visit Preview Apr 12, 2024 4:04am

@Jermolene
Copy link
Owner

Thanks @BurningTreeC I am just linking this back to the earlier discussion in #8125.

Sorry for the delay. I am now a bit concerned that this is a lot of complexity to introduce in order to be able to attempt the optimisation proposed in #8105. However, I am not sure that at this point we have confidence that the eventual performance improvements will be worthwhile.

Does this PR as it stand give you enough material to be able to explore the performance impact on #8105?

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.

None yet

2 participants