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

Stop using hacky features in default theme #2489

Closed
4 tasks done
Mister-Hope opened this issue Jun 9, 2023 · 1 comment
Closed
4 tasks done

Stop using hacky features in default theme #2489

Mister-Hope opened this issue Jun 9, 2023 · 1 comment

Comments

@Mister-Hope
Copy link
Contributor

Mister-Hope commented Jun 9, 2023

Is your feature request related to a problem? Please describe.

Yes, the default theme has a built-in local search, while it's importing dataSymbol, which is private and not accessable outside vitepress.

import { dataSymbol } from '../../app/data'

By importing this symbol, the built-in local search achieves "mocking pageData in another app instance" and render other page as components.

This is unfair for third party themes, as they do not have same ability to this tricky job and provide a similar built-in theme.

Describe the solution you'd like

Export this symbol or stop using it. The default theme should not access vitepress private apis to "provide magic". Everything should work outside vitepress in order not to embarrass 3rd party themes.

Describe alternatives you've considered

No response

Additional context

No response

Validations

@Mister-Hope Mister-Hope changed the title Stop using hacked features in default theme Stop using hacky features in default theme Jun 9, 2023
@Mister-Hope
Copy link
Contributor Author

Special mention the original PR creator and reviewer here: @brc-dd @Akryum

@brc-dd brc-dd closed this as completed in a547530 Jun 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant