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

Use ES modules instead of CommonJS as a build target #1295

Open
jackofdiamond5 opened this issue Aug 1, 2024 · 1 comment
Open

Use ES modules instead of CommonJS as a build target #1295

jackofdiamond5 opened this issue Aug 1, 2024 · 1 comment
Assignees
Labels
cli-package igniteui-cli package codegen-angular-schematics core @igniteui/cli-core package 🆕 status: new templates component OR scenario template 🚶 priority: medium

Comments

@jackofdiamond5
Copy link
Member

jackofdiamond5 commented Aug 1, 2024

Description

The implementation of ig update - #1057 - requires the usage of external code that is written in a separate module, and is possibly/preferably exported in a default async member. This means that we need to be able to dynamically import that module wherever it is supposed to be executed. Similar to what Angular are doing with their schematics.

This would require something like this to be implemented:

const { default: func } = await import('path/to/factory');
await func();

Currently, the CLI is transpiled to CommonJS and the above dynamic import will become a synchronous require call which is incapable of handling an async module without additional code overhead.

So moving to ES modules is a prerequisite for ig update.

There is already a PR that attempts to do this - #1059 - but it's been so long that it's really outdated and it's probably best to be abandoned and started from scratch.

We need these changes to update the CLI's packages (Core: chalk & glob) as they are heavily outdated, which is part of this task.

Copy link

There has been no recent activity and this issue has been marked inactive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli-package igniteui-cli package codegen-angular-schematics core @igniteui/cli-core package 🆕 status: new templates component OR scenario template 🚶 priority: medium
Projects
None yet
Development

No branches or pull requests

2 participants