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

feat: RedisEventTarget #1299

Merged
merged 10 commits into from
Jul 12, 2022
Merged

feat: RedisEventTarget #1299

merged 10 commits into from
Jul 12, 2022

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Jun 19, 2022

  • This moves the TypedEventTarget type into a standalon package @graphql-yoga/typed-event-target.
  • Adds the @graphql-yoga/redis-event-target package which has a EventTarget implementation based on redis pub/sub using ioredis

Future thoughts:

  • I used Event with a custom data attribute, and now I figured out that there is also CustomEvent, but it is still not available in the latest Node.js. Changing the API to use CustomEvent would be a breaking change, thus for now I kept re-using the Event. In the next major release, we can consider using CustomEvent instead.

Node.js Progress for supporting CustomEvent:

Closes #1297

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2022

🦋 Changeset detected

Latest commit: 9fff3b7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@graphql-yoga/typed-event-target Minor
@graphql-yoga/subscription Minor
@graphql-yoga/redis-event-target Minor
example-redis-pub-sub Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@n1ru4l n1ru4l marked this pull request as ready for review July 8, 2022 10:09
@n1ru4l n1ru4l changed the title feat: add redis event target draft feat: RedisEventTarget Jul 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.........................: 100.00% ✓ 229362      ✗ 0     
     data_received..................: 31 MB   1.0 MB/s
     data_sent......................: 13 MB   440 kB/s
     http_req_blocked...............: avg=1.1µs    min=800ns   med=1µs      max=234.5µs p(90)=1.4µs   p(95)=1.7µs   
     http_req_connecting............: avg=0ns      min=0s      med=0s       max=98.9µs  p(90)=0s      p(95)=0s      
   ✓ http_req_duration..............: avg=195.45µs min=136.5µs med=172.2µs  max=18.98ms p(90)=216.5µs p(95)=242.3µs 
       { expected_response:true }...: avg=195.45µs min=136.5µs med=172.2µs  max=18.98ms p(90)=216.5µs p(95)=242.3µs 
     http_req_failed................: 0.00%   ✓ 0           ✗ 114681
     http_req_receiving.............: avg=17.3µs   min=10.2µs  med=15.8µs   max=8.95ms  p(90)=20.1µs  p(95)=22.7µs  
     http_req_sending...............: avg=5.76µs   min=3.9µs   med=4.59µs   max=6.35ms  p(90)=6.3µs   p(95)=9.1µs   
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s       max=0s      p(90)=0s      p(95)=0s      
     http_req_waiting...............: avg=172.38µs min=118.6µs med=151.69µs max=18.9ms  p(90)=189.6µs p(95)=211.8µs 
     http_reqs......................: 114681  3822.517127/s
     iteration_duration.............: avg=256.93µs min=187.2µs med=229.3µs  max=19.4ms  p(90)=288.3µs p(95)=319.79µs
     iterations.....................: 114681  3822.517127/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2022

The latest changes of this PR are available as canary in npm (based on the declared changesets):

@graphql-yoga/common@2.12.0-canary-8bcfabb.0
@graphql-yoga/redis-event-target@0.1.0-canary-8bcfabb.0
@graphql-yoga/typed-event-target@0.1.0-canary-8bcfabb.0
graphql-yoga@2.13.0-canary-8bcfabb.0
@graphql-yoga/node@2.13.0-canary-8bcfabb.0
@graphql-yoga/render-graphiql@2.13.0-canary-8bcfabb.0
@graphql-yoga/subscription@2.2.0-canary-8bcfabb.0

@n1ru4l n1ru4l requested a review from saihaj July 11, 2022 08:28
@@ -3,7 +3,7 @@ import puppeteer from 'puppeteer';
let browser: puppeteer.Browser;
let page: puppeteer.Page;

describe('SvelteKit integration', () => {
describe.skip('SvelteKit integration', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Skipping because it is also broken on master. See #1378

Copy link
Contributor

@charlypoly charlypoly Jul 12, 2022

Choose a reason for hiding this comment

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

@dotansimha @n1ru4l the SvelteKit integration has been broken in the following PR that introduced breaking changes in yoga/common: #1364

@n1ru4l n1ru4l merged commit d024757 into master Jul 12, 2022
@n1ru4l n1ru4l deleted the feat-redis-event-target branch July 12, 2022 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redis EventTarget for PubSub
3 participants