-
Notifications
You must be signed in to change notification settings - Fork 87
chore: add charts demo listing page #10009
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
Conversation
Add a similar `index.html` page that is available in `/dev/index.html` to `/dev/charts/` to make it easier to move between charts dev pages.
web-dev-server.config.js
Outdated
@@ -78,6 +78,8 @@ export default { | |||
// Index page listing | |||
if (['/dev/index.html', '/dev', '/dev/'].includes(context.path)) { | |||
body = generateListing(body, './dev', context.path); | |||
} else if (['/dev/charts/index.html', '/dev/charts', '/dev/charts/'].includes(context.path)) { | |||
body = generateListing(body, './dev/charts', context.path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also update code in generateListing
to add <base href>
tag for /dev/charts
without trailing slash to make sure relative import for common.js
works properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I refactored it a bit to use regex to avoid duplicating the same logic. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but we also need to update this now to get correct listing when running yarn dev:start
:
web-components/dev/rollup.config.js
Line 15 in 366c287
transformHtml: [(html) => appendStyles(html), (html) => generateListing(html)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried something, but it is not working well when the URL has a trailing slash (http://localhost:8000/charts/) because the links in the listing end up with .../charts/charts/...
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. IMO we can accept that /charts
would not work and then just allow /charts/
and /charts/index.html
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed logic for writing <base>
for dev pages build (but preserved it for running yarn start
).
Also modified generateListing()
to list "charts" as a separate entry in the main index.html
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
|
Description
Add a similar
index.html
page that is available in/dev/index.html
to/dev/charts/
to make it easier to move between charts dev pages.