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

Replace require with await import where possible #1614

Merged
merged 2 commits into from
Oct 11, 2020
Merged

Conversation

evantahler
Copy link
Member

To Prepare Actionhero for the world of ESM Modules, this PR removes all instances of require() with import or await import().

The notable exception is the config system, which still relied on require(). We need to wait for top-level await to be generally available in Node.js to upgrade the config system to use import. This is because we need to be able to statically import {config} from "actionhero" and have all files and sub-configs loaded and resolved.

See #1571 for more context.

@evantahler evantahler added the enhancement New feature or request label Oct 11, 2020
@evantahler evantahler changed the title Replace require with await import Replace require with await import where possible Oct 11, 2020
@evantahler evantahler merged commit 4aca28d into master Oct 11, 2020
@evantahler evantahler deleted the no-require branch October 11, 2020 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant