INL / corpus-frontend

BlackLab Frontend, a feature-rich corpus search interface for BlackLab.
16 stars 7 forks source link

Preparations for Vue 3 #480

Open KCMertens opened 4 months ago

KCMertens commented 4 months ago

Upgrading to vue 3 is not currently ongoing!
This is simply an issue to track progress on several underlying problems that need to be solved for a smooth migration.

Moving to a single page application

This will be the biggest hurdle probably.

The vuex store

The store will need probably a complete redo, as we'll need to rewrite it in vue 3 anyway. The store currently uses vuex-typex which is not supported in vue 3, (vuex is no more) to get type safety and remove some boilerplate we'd otherwise need. But we can't take this with us.

Particular warts I'd like to get rid of:

Lower prio work:

RXJS

Organize the streams files, see if we can remove some streams, notably rewrite url and history generation. A regular listener on the store should suffice and be simpler.

jan-niestadt commented 4 months ago

The store will need to clear itself, and load the new corpus info

Maybe we could store corpus information by corpus name? That way, you don't have a single instance of corpus info that you have to (properly) clear and reload (with a lot of potential bugs that put it in a broken state), but can just create a new corpus config object under that corpus' name. Maybe you could have a computed property that always points to the current corpus (if any).

Of course, you don't have to keep corpus info for all corpora in memory; you can just drop everything except the current corpus' info.

I don't know if this is a good idea or not; depends on what's more complex to implement/maintain of course.

async initialization of the corpus module. Right now this is required because when the page loads we don't know for sure whether the current user is allowed to see the corpus.

I'm not sure what you mean by the async loading of corpus info and user permissions. If a user isn't allowed to see a corpus, it's probably alright if they can see the size and fields in the corpus, right? It's the content that's restricted, not the metadata.