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

Convert the streaming server to ESM #29389

Merged
merged 2 commits into from Feb 27, 2024
Merged

Conversation

renchap
Copy link
Sponsor Member

@renchap renchap commented Feb 24, 2024

This is supported by Node 16+

Some notes:

  • __dirname does not work in ES modules, but you can get the same result
  • delete session was a no-op, because delete can only operate on object properties. Using ESM forces strict-mode, which fails at parsing on this rather than silently ignoring the statement. Added a comment to fix this in a future refactor.
  • eslint does not support yet ESM configs (this will be supported in eslint 9), so the file has been kept as cjs

@renchap renchap added the streaming Streaming server label Feb 24, 2024
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.10%. Comparing base (86500e3) to head (6f5aa75).
Report is 169 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29389      +/-   ##
==========================================
+ Coverage   85.01%   85.10%   +0.08%     
==========================================
  Files        1059     1062       +3     
  Lines       28277    28352      +75     
  Branches     4538     4548      +10     
==========================================
+ Hits        24040    24129      +89     
+ Misses       3074     3061      -13     
+ Partials     1163     1162       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ThisIsMissEm ThisIsMissEm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

streaming/.eslintrc.cjs Outdated Show resolved Hide resolved
streaming/index.js Outdated Show resolved Hide resolved
streaming/index.js Show resolved Hide resolved
This is supported by Node 16+

Some notes:
- `__dirname` does not work in ES modules, but you can get the same result
- `delete session` was a no-op, because `delete` can only operate on object properties. Using ESM forces strict-mode, which fails at parsing on this rather than silently ignoring the statement. Added a comment to fix this in a future refactor.
- eslint does not support yet ESM configs (this will be supported in eslint 9), so the file has been kept as cjs
ykzts
ykzts previously approved these changes Feb 27, 2024
streaming/.eslintrc.cjs Outdated Show resolved Hide resolved
streaming/index.js Show resolved Hide resolved
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
@renchap renchap added this pull request to the merge queue Feb 27, 2024
Merged via the queue into mastodon:main with commit 036f5a0 Feb 27, 2024
28 checks passed
@renchap renchap deleted the streaming-to-esm branch February 27, 2024 15:04
lutoma pushed a commit to ohaisocial/mastodon that referenced this pull request Mar 19, 2024
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
streaming Streaming server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants