-
Notifications
You must be signed in to change notification settings - Fork 106
fix(tools): correct lightdom css routing, improve trailing slash behavior #2944
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
|
✅ Commitlint tests passed!More Info{
"valid": true,
"errors": [],
"warnings": [],
"input": "fix(tools): correct lightdom css routing, improve trailing slash behavior"
} |
| decodeURIComponent(demo.source?.href.replace(options.sourceControlURLPrefix, '') ?? ''); | ||
| // split the demoSource into an array of parts | ||
| const demoSourceParts = demoSource.split('/'); | ||
| // if demoSourceParts contains options.elementsDir, then build the filePath from the rootDir and the demoSource |
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.
This might be a naive change. Perhaps we should only check if the first part of the demo source matches the elementsDir? @bennypowers thoughts?
|
|
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
adamjohnson
left a comment
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.
Dunno if you wanna also try tackling adding a trailing slash to non-index.html demos. Otherwise, LGTM 👏 .
| /** | ||
| * Ensures trailing slash for component URLs | ||
| * FROM: `/elements/footer` | ||
| * TO: `/elements/footer/` | ||
| * @param config normalized PFE dev server config | ||
| */ | ||
| const ensureTrailingSlashMiddleware: PfeMiddleware = () => (ctx, next) => { |
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.
This is a minor nitpick, but if:
http://localhost:8000/components/jump-links
will add the trailing /, would it also be worthwhile to add the trailing slash to the other demos as well? eg:
http://localhost:8000/components/jump-links/demo/centered-list
...becomes...
http://localhost:8000/components/jump-links/demo/centered-list/
Feel free to resolve if this is out of scope.
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.
the trailing slashes themselves were kinda a nitpick of my own, so why not solve one more case.
|
This probably needs a changeset. |
|
Sorry for the delay in review. Please consider that an indication of how ill-advised my original approach is, moreso than as a comment on your changes That being said, I have questions:
|
|
| * TO: `elements/pf-jazz-hands/pf-jazz-hands-lightdom.css` or `elements/pf-jazz-hands/pf-jazz-hands-lightdom-shim.css` | ||
| * @param config normalized PFE dev server config | ||
| */ | ||
| const lightdomShortPathMiddleware: PfeMiddleware = config => (ctx, next) => { |
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.
does this need to be hardcoded at the pfe level? IIRC we don't have lightdom stylesheets here. It would be better to implement this middleware in rhds's wds config
|
Closed in favor of downstream fix. RedHat-UX/red-hat-design-system#2663 |
What I did
Testing Instructions
-lightdom.cssto a component and link in a demo. Ensure lightdom css is properly linked.Notes to Reviewers