Skip to content

Conversation

@mkucmus
Copy link
Contributor

@mkucmus mkucmus commented Dec 10, 2025

Description

adds missing PageRef component, responsible for displaying internal links with description.

Type of change

Bug fix (non-breaking change that fixes an issue)

@vercel
Copy link

vercel bot commented Dec 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
frontends-demo Ready Ready Preview Dec 11, 2025 0:01am
frontends-vue-starter-template Ready Ready Preview Dec 11, 2025 0:01am
1 Skipped Deployment
Project Deployment Preview Updated (UTC)
shopware-frontends-docs Skipped Skipped Dec 11, 2025 0:01am

@mkucmus mkucmus requested a review from BrocksiNet December 10, 2025 08:02
@mkucmus mkucmus requested a review from bojanrajh December 10, 2025 08:03
{
enhanceApp({ app }: { app: App }) {
// app.component("AI", AI);
app.component("PageRef", PageRef);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bojanrajh can we register this component also locally? I guess you overwrite it anyway in developer portal right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, wdyt about having a redirection from frontends.shopware.com -> https://developer.shopware.com/frontends/ ?

we have only one note: missing overview page, replaced by welcome page with a really nice graphics ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep it for now, separate domain is nice when you want to browse only frontends specific stuff, otherwise global search is fine but it's not for everyone and could be overwhelming for someone who just wants to have pretty shop ;)

Comment on lines 9 to 19
export default Object.assign(
{
...SWAGTheme(),
},
{
enhanceApp({ app }: { app: App }) {
// app.component("AI", AI);
app.component("PageRef", PageRef);
// app.provide('some-injection-key-if-needed', VALUE)
},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, your theme overrides the whole enhanceApp() from the base theme. This should fix it.

Suggested change
export default SWAGTheme()

You can then enhance the app by passing the enhanceApp as a config:

export default SWAGTheme({
  enhanceApp({ app }: { app: App }) {
    // app.component("PageRef", PageRef);
  }
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for mentioning it! unfortunately, the last change that makes PageRef links relative (by adding a dot ".") breaks our internal docs navigation.

it takes wrong current dir as a context to relative link. so now the PageRef creates a link 57d179d#diff-1097c28b29e09dfb83f3fd2058a9c06e54c2ee81c47ebf312517019a281f9f0fR69 but relatively from "templates" dir, not the base docs path. that leads to 404... @bojanrajh does it work in developer portal context or we need to provide some fix for that?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after that change the problem should be gone.

"scripts": {
"dev": "vitepress",
"build": "vitepress build",
"build:devhub": "VITEPRESS_BASE=/frontends/ vitepress build",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bojanrajh I added the usage of withBase() function of vitepress to enable you and us to control the prefix in URL. since now on we can continue to provide an absolute path for PageRefs globally.

that fixes the problem in both environments - dev portal and our standalone docs.

cc: @patzick

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure? How does developer-portal know when to apply the /frontends base? The PageRef component from this repo is never registered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, there is no other way to reconcile two environments I guess... so my suggestion would be to provide awareness of baseUrl the docs are deployed under.

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.

5 participants