Skip to content
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

Update to standalone components #1174

Merged
merged 36 commits into from
Dec 11, 2023
Merged

Update to standalone components #1174

merged 36 commits into from
Dec 11, 2023

Conversation

jackofdiamond5
Copy link
Member

@jackofdiamond5 jackofdiamond5 commented Nov 17, 2023

Closes #1165

Allows the igniteui-cli to generate standalone components. This is achieved by separating the templates' structure in two - one for legacy (module-based) apps and one for apps with standalone components. The project structure for standalone components has been reworked so that it matches the project structure of an ng new with standalone components.

Every template for every component that's supported by the cli has been updated to be standalone (in the standalone project structure) and has been cleared out of any redundant configurations.

Routing has been reworked so that now under the src/app folder there will be a app.router.ts containing all the routes which is then imported in the app.config.ts alongside any other global providers. The config file is then provided in the main.ts where the application bootstrapping occurs.

Additionally, for all of the custom templates that exist in the cli, the ability to modify a @Component metadata had to be introduced since the templates allow the addition of some or all features of the given component, this concerns mainly the custom grids. This caused the need for the cli to be able to add the imports property in the @Component decorator since now all templates are marked as standalone by default and we could not just hardcode all of the required dependencies for these components since this would create too much boilerplate code for any templates that just show a bare bones custom grid for example. So, relying on the template's dependencies with their imports marked as standalone an additional component transformer was introduced that creates a new imports array in the component's meta.

Action list:

  • Separate standalone from module-based projects
  • Update default standalone projects
    • base
    • base-with-home
    • empty
    • side-nav
    • side-nav-auth
  • Update routing for all standalone projects
  • Update standalone templates
    • Update custom templates to standalone
  • Set up a way to generate standalone & legacy projects through prompt session & the ig command
  • Docs

@jackofdiamond5 jackofdiamond5 added 🛠️ status: in-development angular-modules templates component OR scenario template core @igniteui/cli-core package codegen labels Nov 17, 2023
@coveralls
Copy link

coveralls commented Nov 17, 2023

Coverage Status

coverage: 65.923% (-0.4%) from 66.277%
when pulling c2ba933 on bpenkov/standalone-components
into 4609525 on master.

@jackofdiamond5 jackofdiamond5 force-pushed the bpenkov/standalone-components branch from bb7fee5 to c7158b7 Compare November 21, 2023 14:45
Lipata
Lipata previously approved these changes Dec 8, 2023
@jackofdiamond5
Copy link
Member Author

jackofdiamond5 commented Dec 8, 2023

Currently DockManger throws this error when started:
image

However, this is not a problem with the cli but potentially with the DM package. Since we are initializing the DM in a standalone component, we may need to export the DM component (and potentially some of its internal components) from the package alongside its interfaces, etc. #ref DM issue

@jackofdiamond5 jackofdiamond5 force-pushed the bpenkov/standalone-components branch from 333c3df to c2ba933 Compare December 11, 2023 08:44
@Lipata
Copy link
Member

Lipata commented Dec 11, 2023

Tested with licensed and non-licensed for base, empty, and default templates - for the new standalone default and old legacy one. Everything seems fine, without the following:

They are separate issues so I will proceed with merging this PR.

@Lipata Lipata merged commit 0b3316a into master Dec 11, 2023
4 checks passed
@Lipata Lipata deleted the bpenkov/standalone-components branch December 11, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
angular-modules codegen core @igniteui/cli-core package templates component OR scenario template ✅ status: verified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update CLI to use stand-alone components
5 participants