Migration to NX and refactor of Utils and Core into libraries.#4019
Migration to NX and refactor of Utils and Core into libraries.#4019FrancescoMolinaro wants to merge 33 commits into
Conversation
…reState in tests files, move remote data utils into core
…r, move config (app) into core, move core states files into core folder, replace import of some constants for route paths with strings to avoid import/dependency from other part of the app
…r, move config (app) into core, move core states files into core folder, replace import of some constants for route paths with strings to avoid import/dependency from other part of the app
… of AppState + move notification state in core
…ndex.ts files, refactor import
|
Hi @FrancescoMolinaro, |
|
@FrancescoMolinaro : Now that #3997 has been merged, it'd be good to rebase this PR against To everyone watching this PR: as noted in Developer Meetings, I'm still not certain whether we'll be able to include this in the 9.0 release (as most other developers have not had experience with the changes in this PR & the changes seem rather significant). But, at the very least, I'd like to get more eyes on this so that we can make a decision as to whether to consider it for 9.0, or perhaps merge it directly after the 9.0 release (so that developers can get more experience with it prior to the 10.0 release). |
|
@pcg-kk : When you have a chance, could you add details / links regarding the feedback you shared about Nx in yesteday's Developer Meeting? If, for some reason, you'd rather keep this feedback off of GitHub, you also could add it as a comment to the wiki page which describes this effort: https://wiki.lyrasis.org/display/DSPACE/DSpace+Angular+%3A+library-based+architecture+proposal (If you choose the wiki approach, let me know if you need an account. I just need an email to send your account signup to.) Based on your feedback, I did a little digging on Nx support for Angular and their responsiveness to tickets in general.
Thanks in advance! |
|
@tdonohue , sorry that I answered just today, but I was so busy last week. I would like to challenge a team with Angular CLI Workspaces. Did we think about that? Why do we resign from this flow if the reason for NX is just to introduce separate libraries? Unnecessary Complexity for a Single Application The DSpace project is a monolithic Angular application. NX's primary value proposition is managing multiple applications and libraries in a monorepo. Adding NX would introduce additional tooling overhead without corresponding benefits. Security updates and dependency management become more complex too, because of the NX dependencies and subpackages. Established Build and Development Workflow The project already has a well-established Angular CLI-based setup with standard configuration angular.json . Custom webpack configurations and build scripts are already in place. Migrating to NX would require significant refactoring of existing build processes and configurations for all users. NX requires more knowledge about the process The development team of DSpace consists of domain experts rather than large-scale enterprise developers. A lot of contributors don’t know NX's enterprise-focused features (affected testing, distributed caching), and we increase the level of complexity for them. Deployment and CI/CD Simplicity The current deployment model uses Docker with straightforward build processes. NX's advanced features like affected builds and distributed caching, are unnecessary for typical DSpace deployment scenarios. During daily work, there are almost no pros. Maintenance Overhead NX introduces additional dependencies and potential breaking changes across versions. We have zero influence on the project structure (it is decided by NX devs) and every time when they change it, a lot of existing projects have a problem updating to the new one version. In my opinion, it’s worth mentioning also existing projects. Recently, we had a huge structure update with a new Angular structure; now it will be another high migration effort with uncertain benefits for standard DSpace usage. Why not just Angular CLI Workspaces? And in the end, I would like to ask why we don’t use just Angular CLI Workspaces? It is built in Angular CLI, it supports libraries. It doesn’t change a structure, no new dependencies, no migrations with NX flow, no NX issues to solve for users. |
DSC-2683 Fix admin sidebar logic to enable external links Approved-by: Andrea Barbasso
References
https://wiki.lyrasis.org/display/DSPACE/DSpace+Angular+%3A+library-based+architecture+proposal
Work includes also #3997 as we started from there to avoid future conflicts.
Description
This PR is a follow up of the migration to standalone components done in DSpace 8, with the goal of a modular architecture.
The new code serves two main purposes, first it introduces NX in the project as build orchestrator, second it introduces two new libraries: Core and Utils.
Instructions for Reviewers
The app needs to be running as before and the commands to run it remain unchanged.
List of changes in this PR:
Migrated from an Angular CLI project to a NX standalone App.
The Angular CLI has been replaced by the NX CLI.
Created two new libraries Core and Utils:
2.a Moved all data services and related models into Core.
2.b Moved some of the states from AppState to CoreState to isolate the library.
2.c Replaced in the whole library the environment import with injection token.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.