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 · 3 comments
Open

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

mirror-kt opened this issue Apr 14, 2023 · 3 comments
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code semver:major
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!

@filmaj
Copy link
Contributor

filmaj commented Aug 28, 2024

The current major version of bolt supports all the way back to node 14. I am slowly working towards a new major version, which will drop node support prior to v18. It was hard to find information about when exactly node: prefix was introduced, but it seems like some minor versions of v12 and v14 support it. So, I think we can make this switch when we drop support for node v14 (which should happen in 4.0).

@filmaj filmaj modified the milestones: 4.x, 4.0.0 Aug 28, 2024
@filmaj filmaj added semver:major dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code and removed discussion M-T: An issue where more input is needed to reach a decision labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code semver:major
Projects
None yet
Development

No branches or pull requests

3 participants