Skip to content

Removed theme modules#4446

Merged
tdonohue merged 2 commits intoDSpace:mainfrom
alexandrevryghem:w2p-132007_remove-theme-modules_contribute-main
Feb 3, 2026
Merged

Removed theme modules#4446
tdonohue merged 2 commits intoDSpace:mainfrom
alexandrevryghem:w2p-132007_remove-theme-modules_contribute-main

Conversation

@alexandrevryghem
Copy link
Member

Description

Currently all the themed components in src/themes have been migrated to standalone declaration, but they don't work unlesss they are referenced inside either the LazyThemeModule or EagerThemeModule. I updated the config in order to remove this constraint, this way we won't have to fix merge conflicts in those files anymore.

The reason why those modules were still necesarry is because the tconfig.*.json files only compile the *.module.ts files inside the src/themes folder. Since those modules contained imports to all the components inside the theme, they were automatically comiled as well. I updated the config to compile all the typescript files inside the src/themes folder, this way we can drop the modules.

Instructions for Reviewers

List of changes in this PR:

  • Updated the tsconfig.*.json files to compile all the typescript files inside the src/themes folder instead & removed the unused angularCompilerOptions.entryModule property that isn't being used anymore since the switch to standalone components
  • Removed all the LazyThemeModules
  • Removed all the EagerThemeModules and replaced them with 2 arrays:
    • lazy-listable-components.ts#LISTABLE_COMPONENTS: This is similar to the old ENTRY_COMPONENTS array, but it only contains imports for components that use @listableObjectComponent decorators. Other dynamically loaded components that don't use custom decorators like StartsWithDateComponent should be declared in the decorator files instead (e.g. starts-with-decorator.ts).
    • eager-theme-components.ts#COMPONENTS: This is similar to the DECLARATIONS array from the old EagerThemeModule, except that it doesn't contain the ENTRY_COMPONENTS entries

Guidance for how to test or review this PR:

  • Verify that everything still works as expected (you can test it with the custom & eager theme)
  • Verify the bundle size didn't increase (you can use build:stats for this)

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@alexandrevryghem alexandrevryghem self-assigned this Jun 11, 2025
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Jun 11, 2025
@alexandrevryghem alexandrevryghem force-pushed the w2p-132007_remove-theme-modules_contribute-main branch from a0ebe23 to d7c6b36 Compare July 3, 2025 23:33
@alexandrevryghem alexandrevryghem added this to the 10.0 milestone Aug 22, 2025
@github-actions
Copy link

Hi @alexandrevryghem,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

# Conflicts:
#	src/app/core/shared/listable.module.ts
@alexandrevryghem alexandrevryghem force-pushed the w2p-132007_remove-theme-modules_contribute-main branch from d7c6b36 to 1b2541f Compare November 30, 2025 22:31
@tdonohue tdonohue moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 10.0 Release Jan 15, 2026
Copy link
Contributor

@FrancescoMolinaro FrancescoMolinaro left a comment

Choose a reason for hiding this comment

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

Hi @alexandrevryghem, many thanks for the change and sorry for the delay on the review.
I did some tests and checked the code, it looks great and I didn't experience any issue so I am going to approve this one.

Thanks again!

@tdonohue tdonohue moved this from 👀 Under Review to 👍 Reviewer Approved in DSpace 10.0 Release Jan 26, 2026
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @alexandrevryghem ! This looks good to me too. I tested it to verify custom themes are still working, including different themes for different collections or paths.

Just a note though, I think this will require minor Documentation updates to https://wiki.lyrasis.org/display/DSDOC10x/User+Interface+Customization as that page mentions the lazy-theme.module.ts and eager-theme.module.ts. Could you update those docs when you get the chance?

In the meantime, I'm going to merge this with +2 votes.

@tdonohue tdonohue merged commit 346bdb8 into DSpace:main Feb 3, 2026
15 checks passed
@github-project-automation github-project-automation bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace 10.0 Release Feb 3, 2026
@tdonohue tdonohue added the needs documentation PR is missing documentation. All new features and config changes require documentation. label Feb 3, 2026
@alexandrevryghem alexandrevryghem deleted the w2p-132007_remove-theme-modules_contribute-main branch February 3, 2026 23:31
@alexandrevryghem
Copy link
Member Author

@tdonohue: I've updated the docs

@alexandrevryghem alexandrevryghem removed the needs documentation PR is missing documentation. All new features and config changes require documentation. label Feb 4, 2026
@tdonohue
Copy link
Member

tdonohue commented Feb 4, 2026

Thanks @alexandrevryghem ! One last question for you... is this a "breaking change" for existing themes? It seems like it may be considering a site now may need to update eager-themes-components.ts and lazy-listable-components.ts. The reason I ask is this change may need to be added to the draft 10.0 Release Notes as a "Breaking Change".

Do you have any recommendations for sites in migrating older 9.x themes to this new 10.0 theme structure? It seems like we may want to add those to the "Breaking Changes" section of the Release Notes in some way. (I'd be glad to help with this, but I'm not sure I know what is required in migrating a 9.x theme to 10.0 and what is optional.)

@alexandrevryghem
Copy link
Member Author

@tdonohue: Yes indeed users will have to migrate their old module files to this new format, so they should follow these steps:

  • Delete all the src/themes/*/lazy-theme.module.ts files
  • Create new src/themes/*/eager-theme-components.ts files in all your themes similar to the one from the dspace theme. Inside the COMPONENTS array put all the components from the EagerThemeModule#DECLARATIONS (no need to copy the components from ENTRY_COMPONENTS)
  • Update the src/themes/eager-themes-components.ts to reference all the src/themes/*/eager-theme-components.ts of the active themes
  • Create new src/themes/*/lazy-listable-components.ts files in all your themes similar to the one from the dspace theme. Inside the LISTABLE_COMPONENTS array put all the components from the EagerThemeModule#ENTRY_COMPONENTS
  • Update the src/themes/themes-listable-components.ts to reference all the src/themes/*/lazy-listable-components.ts of the active themes
  • Delete all the src/themes/*/eager-theme.module.ts files

NOTE: when #4528 is merged the fourth & fifth step can be removed, because that PR will delete the src/themes/themes-listable-components.ts & src/themes/*/lazy-listable-components.ts files

@tdonohue
Copy link
Member

tdonohue commented Feb 4, 2026

@alexandrevryghem : Thanks for those notes. I've created a new section of the theme docs called "Upgrading an Existing Theme" and added a section for "Upgrading from 9.x to 10.x".

I've copied your instructions into that location & tried to give examples (based on the changes made in this PR). If you have a chance, please review this.

I'll also add a new to the Release Notes referencing this theme upgrade section.

@alexandrevryghem
Copy link
Member Author

Looks great thnx @tdonohue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants