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 node:-prefixed imports for Node.js core modules #1803

Open
mirror-kt opened this issue Apr 14, 2023 · 2 comments
Open

Use node:-prefixed imports for Node.js core modules #1803

mirror-kt opened this issue Apr 14, 2023 · 2 comments
Labels
discussion M-T: An issue where more input is needed to reach a decision
Milestone

Comments

@mirror-kt
Copy link

mirror-kt commented Apr 14, 2023

FYI: nodejs/node#36098

The node:-prefix was introduced to avoid namespace conflicts when importing Node.js core modules.
At this time, it does not affect the operation without prefixes, but since some modules, such as node:test, require prefixes, I suggest that you modify your entire codebase with prefixes while you are at it.

Also, as a side effect of prefixing, you may be able to run bolt on Cloudflare Workers.
Cloudflare Workers has announced the availability of Node.js compatible APIs, but the node:-prefix is now required to use them.
Details of how to run on Cloudflare Workers should be a separate issue, but this possibility is a great motivation to introduce prefixes.

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch seratch added discussion M-T: An issue where more input is needed to reach a decision and removed untriaged labels Apr 14, 2023
@seratch
Copy link
Member

seratch commented Apr 14, 2023

Hey @mirror-kt, thanks for sharing your knowledge!

Since bolt-js internally relies on a few modules that do not work on Cloudflare Workers or other similar platforms, which do not natively support Node.js runtime APIs. In particular, using axios for HTTP communications is a key blocker for it. Until axios and some other modules start supporting cf-workers, simply adding the prefix on this project's side does not help.

With that being said, if this option proves valuable for a broader audience in the future, we may consider working on it. Thanks again for the suggestion!

@seratch seratch added this to the 4.x milestone Apr 14, 2023
@seratch
Copy link
Member

seratch commented Apr 14, 2023

FWIW, if you are looking for a currently available solution to build Slack apps on Cloudflare Workers, my personal hobby project may be useful for you: https://github.com/seratch/slack-cloudflare-workers The project is still very young, but I've been actively working on it lately!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion M-T: An issue where more input is needed to reach a decision
Projects
None yet
Development

No branches or pull requests

2 participants