Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jonkoops
Copy link
Contributor

Removes the node_modules directory generated by PNPM from the 'common' resources directory. This prevents files that are not needed from unnecessarily ending up in the final distribution. This also removes the alpinejs and jquery dependencies, as they are no longer used anywhere.

Closes #24861

@keycloak-github-bot

This comment was marked as outdated.

keycloak-github-bot[bot]

This comment was marked as outdated.

@jonkoops jonkoops force-pushed the reduce-common-resources branch from c3baca8 to 7075ced Compare August 20, 2024 18:03
edewit
edewit previously approved these changes Aug 21, 2024
ahus1
ahus1 previously approved these changes Aug 21, 2024
Copy link
Contributor

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

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

Hi @jonkoops - thank you for this cleanup.

I'm approving, and leaving it up to you to merge it as is with just one note:

  • I see you remove JQuery and Alpine. Is that worth mentioning in the release notes if people use them in their customized themes?

Other thoughts which shouldn't touch this PR:

  • Cleaning out some resource from the vendor folder could be problematic as we allow people to customize the layouts, and then all resources from Patternfly should be available. The one thing I could think off: Removing WOFF font files where we have WOFF2 fonts available. But as those are referenced in the CSS, I'd rather go with them as is, and I see that the latest v5 has removed them.
  • It is a pity we need to include three patternfly versions. I hope we can soon skip one of them.

@jonkoops
Copy link
Contributor Author

I see you remove JQuery and Alpine. Is that worth mentioning in the release notes if people use them in their customized themes?

Yes, this might be worth mentioning, as well as the changed paths to the various PatternFly versions. As well as the changed paths to the PatternFly libraries. I'll add some notes to the migration guide.

Cleaning out some resource from the vendor folder could be problematic as we allow people to customize the layouts, and then all resources from Patternfly should be available.

Sorry, but I don't quite understand what you are saying here? You mean to say that the changes in this PR right now might be breaking in the sense that not all assets that were previously present are here now? Or, do you mean to say that changing this in the future could be problematic? How do layouts relate to this, are you referring to DOM + styling, or the filesystem layout/directory structure?

The one thing I could think off: Removing WOFF font files where we have WOFF2 fonts available. But as those are referenced in the CSS, I'd rather go with them as is, and I see that the latest v5 has removed them.

This also crossed my mind, it is very unlikely the WOFF v1 variant would ever be requested by a user agent, as all modern ones support WOFF v2. Still, it might happen, and it is supported by PatternFly, so we have to support it as well. This does remind me that I wanted to contribute a PR upstream to remove WOFF v1 support for PatternFly 6, so I'll go ahead and do that now so we can reduce the amount of assets in the future.

Another massive one is all the various images that are included by PatternFly by default, I am sure we're not using the majority of them, but again, can't really be sure, so best to keep them around for the time being.

It is a pity we need to include three patternfly versions. I hope we can soon skip one of them.

Indeed, this is a bummer. Unfortunately, in order to give folks time to switch over to the new login theme we'll have to carry the dependency on PatternFly 3 and 4 for the entire lifecycle of Keycloak 26. The PatternFly 6 release is also just around the corner, so it could very well be that we'll have four distinct versions of PatternFly in the distribution.

@jonkoops jonkoops dismissed stale reviews from ahus1 and edewit via f36ec93 August 21, 2024 14:20
@jonkoops jonkoops force-pushed the reduce-common-resources branch from 7075ced to f36ec93 Compare August 21, 2024 14:20
@jonkoops jonkoops requested review from ahus1 and edewit August 21, 2024 14:20
edewit
edewit previously approved these changes Aug 21, 2024
@ahus1
Copy link
Contributor

ahus1 commented Aug 21, 2024

Cleaning out some resource from the vendor folder could be problematic as we allow people to customize the layouts, and then all resources from Patternfly should be available.

Sorry, but I don't quite understand what you are saying here? You mean to say that the changes in this PR right now might be breaking in the sense that not all assets that were previously present are here now? Or, do you mean to say that changing this in the future could be problematic? How do layouts relate to this, are you referring to DOM + styling, or the filesystem layout/directory structure?

This was referring to: If you remove reduce the images in Patternfly to those we currently use, this would give those customizing the pages a hard time as only some of the images are present. So let's include the full Patternfly themes, and not try to include only some images.

This refers to the TODO in pom.xml you added:

TODO: We can likely include the resources below more selectively to reduce the total size of the distribution.

So you might consider changing the wording here, or actually remove it if you choose not to remove anything from the themes.

ahus1
ahus1 previously approved these changes Aug 21, 2024
@jonkoops
Copy link
Contributor Author

Thanks for clarifying @ahus1. I've removed the todos, we're more likely to drop most of these dependencies in the future anyways, with the exception of the latest PatternFly.

@jonkoops jonkoops force-pushed the reduce-common-resources branch from f36ec93 to 91d3290 Compare August 21, 2024 14:28
@jonkoops jonkoops requested review from ahus1 and edewit August 21, 2024 14:28
@ahus1 ahus1 self-assigned this Aug 21, 2024
@jonkoops jonkoops enabled auto-merge (squash) August 21, 2024 14:34
@jonkoops jonkoops merged commit 5ac8ffa into keycloak:main Aug 22, 2024
@jonkoops jonkoops deleted the reduce-common-resources branch August 22, 2024 09:24
edewit pushed a commit to edewit/keycloak that referenced this pull request Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move unrelated files out of 'common' resources

3 participants