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

Opt-in streaming to Prettier #29447

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nschonni
Copy link
Contributor

Alternate attempt to start #29429
As, the ESLint rules are still conflicting, adding a file level ignore that would eventually get flagged/removed with the --report-unused-disable-directives --fix once the rules are properly removed in the other PR

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.10%. Comparing base (86500e3) to head (eb4a23d).
Report is 1176 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29447      +/-   ##
==========================================
+ 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

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@nschonni
Copy link
Contributor Author

@ThisIsMissEm you're mainly the author of the files in this folder, so it would likely impact you most. If you're not interested I can just close this one

@ThisIsMissEm
Copy link
Contributor

This, as well as converting the streaming server to typescript are things we're interested in, however getting the streaming server's code to a point where it makes sense to enable takes priority.

basically we need to detangle a lot of mess in the streaming server to improve performance, testability, and a whole lot more.

I wouldn't expect constant rebases here, perhaps this is better summed up in an issue?

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@nschonni nschonni force-pushed the streaming-prettier branch from 9b2fdb7 to 88e3295 Compare August 30, 2024 22:05
@ThisIsMissEm
Copy link
Contributor

Perhaps one path forwards here would be to opt everything new in streaming into prettier, but exclude streaming/index.js for now?

That way it wouldn't conflict with ongoing work.

Essentially I'm trying to refactor how subscriptions happen in streaming to be sort of map/set based, instead of a hash of nested callbacks.

We should eventually be able to inject a payload or request into streaming and assert things about it's behaviour. The current complete lack of tests make behavior very uncertain and we can accidentally introduce bugs: the only type of tests we can write today are end-to-end system tests for the bulk of streaming.

Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@nschonni
Copy link
Contributor Author

@ThisIsMissEm I'm happy if you want to just roll this into one of your own PRs too, it might be more likely to land and not conflict with the real changes you're working on 😆 . After is in the Husky hooks should autofix the files as you commit them, so it shouldn't conflict.
I don't need commit credit, so if you want to redo this:

  • Copy the .prettierignore line to opt-in
  • run yarn format to let prettier try to autofix stuff
  • add /* eslint-disable indent */ at the top of any of the files that ESLint complains about (for the conflicting case statements

Or you could do most of that but add an extra ignore for the index.js in the .prettierignore after the folder opt-in

Copy link
Contributor

github-actions bot commented Sep 4, 2024

This pull request has merge conflicts that must be resolved before it can be merged.

@mjankowski
Copy link
Contributor

Another similar one - not sure if this could close for rationale here - #26715 (comment) - (forks/PRs churn), or if there's something more viable to pull out. Also not sure on conclusion of above discussion re: doing this first vs letting it roll into future refactor PRs.

@ThisIsMissEm
Copy link
Contributor

In general I'm trying to get the streaming server code into better shape first before having the code churn that reformatting this code would incur. Anything that's not streaming/index.js could be run through prettier, but the main file still remains a bit of a mess with lots of room for things to go wrong.

Probably the first next step is going to be moving the database queries out of the hot path for sending messages, which should simplify streamFrom significantly. I've also a PR where I'm trying to move towards better management of the Redis subscriptions and trying to detangle things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants