-
Notifications
You must be signed in to change notification settings - Fork 920
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
refactor(theme-default): set theme data in client config (close #946) #1052
Conversation
c9f9d59
to
fe5f4c5
Compare
@meteorlxy Anxiously waiting for this one to come through, will be an amazing change 💯 |
@meteorlxy Any chance of this getting some love? It's been a few months. |
Busy working these days. Will be back to this soon. |
BREAKING CHANGE: now you should set default theme locales data in `.vuepress/client.ts` via `defineThemeData` BREAKING CHANGE: now `plugin-theme-data` does not need options anymore
fe5f4c5
to
d1ef73f
Compare
We shall not remove the old plugin as it's total reasonale to read the options both side. Some options may related to temp file generating and assets handling. ExamplesTree shakableA simple example is So for a third party theme, it might drop frontmatter support, so that when users set The above example is simple, but actions like this can improve "Tree shaking" ability and reduce the final output bundle size. Any global option controlling something all have a chance to do some "tree shakable" work, droping unneeded code. Node based operationsSome features may related to node based api, and can not be handled at client side, for example, my theme So I suggest @meteorlxy reconsidered |
All it needs to allow for that i need myself, is that if add a new MD file that it automatically picks it up, the navigation bar automatically updates and that it doesn't need a server restart for it. I also get the files automatically tree into the navigation, but every time i do it required a restart to display on the menu, this does not make sense, it should be automatic and dynamic, as long as we can achieve that then i'm satisfied. Ofcourse, however you guys decide to go about it, if it's part of a greater change, it would be very helpful.. it's desperately needed. |
@Mister-Hope I've been scratching my head at this for a while and I've tried a lot of ways to get past it, but it seems like i just can't get the navigation to be dynamic. Do you have any suggestions that i can try to temporarily alleviate the problem, this wasn't a issue in webpack because of hot reload but in vite this is a problem because i can't access the hot reload in the config. Even if it means that the server restarts after a new page at this point i have to manually do that, do you have any ideas that i can use besides re-making the entire navigation?
Watchers don't detect or should i say trigger the navigation to update in the config so i'm at a loss. What i'm trying to do: Adding a page should automatically be added to the navigation without restarting it, but if it does need a restart (for now) for it to be automatic. |
The problem is that pageRoutes can not be hmred, so if you add new page, a restart is expected. |
@Mister-Hope |
@Mister-Hope I'm kind of facing the same problem, but even more basic. All I want to do is fetch pages from a CMS and add them to the navigation bar, but I can't find a way to modify the navbar programmatically. How did you go about this? |
@Radiergummi A alternative is to remake the navigation, i did so for mine and i use a json to fill the gap, json being generated by a listener. But i agree, shouldn't be the case and VuePress should be able to do it Programatically even if i inject it. |
Closing as we have migrated default theme into another repo |
close vuepress/ecosystem#58
BREAKING CHANGE: now you should set default theme locales data in
.vuepress/client.ts
viadefineThemeData
BREAKING CHANGE: now
plugin-theme-data
does not need options anymore