-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Doc for @theme-original and @theme-init #3043
Comments
@slorber Could we have more detail about this one, I'm still confused as to what is required |
Sorry I probably didn't explain this well :) if you swizzle a comp, like the Footer, to customize it, sometimes you want to be able to import the original comp of the theme to wrap it. The following does not work:
So I think we have a special import:
instead of
Unfortunately I don't think we have more details about that feature, it's something I know about because I inspected the code. Actually, looking back, the only place where this is used is in the live-codeblock plugin
And it's not even Seems like at some point we renamed one to the other or something, and tried to keep retrocompatibility. @yangshun do you know more about the history of this feature? what about keeping only one alias instead of having 2? That seems like an acceptable breaking change. |
|
Still not sure to understand the difference @yangshun 😅 why can't |
Alexey explained here - #2464 (comment). We definitely need better naming and better docs for this. |
This does seem like an straightforward clarification to add to the docs. Started a PR with proposed changed based on Alexey's explanation. Let me know if this is something that is close to what is wanted or if this needs to be changed. |
Unfortunately the docs have been added to v1 instead of v2. Will port these docs to v2, and also make it more idiomatic to know that ./docs is v1 as it's confusing. |
📚 Documentation
I think this D2 feature is currently not documented.
If we want to override an existing comp, yet reuse the original comp (like, if you want to wrap it), there's a special import alias we can use.
It's worth trying if the following work and document this feature
That could be nice to find a tiny usecase for this feature on D2 website, for dogfooding and ensuring this behavior does not break over time.
The text was updated successfully, but these errors were encountered: