profile
viewpoint
Mateusz Burzyński Andarist @livechat Wrocław, Poland

Andarist/babel-plugin-annotate-pure-calls 64

This plugins helps with annotating top level functions calls with #__PURE__ comment.

aaronshaf/react-callbag-subject 8

Asynchronous pipelines in React using callbags

aaronshaf/callbag-gamepads 7

Callbag source for connected gamepad inputs

aaronshaf/callbag-animation-frames 5

Callbag listenable source sending DOMHighResTimeStamp at display refresh rate

aaronshaf/callbag-keyboard 3

Callbag source for the keyboard

Andarist/are-hook-inputs-equal 3

A comparator function for previous and current React hook inputs.

aaronshaf/callbag-flatten-iter 2

Callbag operator that flattens iterables

Andarist/babel-check-duplicated-nodes 1

🐠 Babel helper module for transforms authors to check the AST against duplicated nodes.

pull request commentatlassian/changesets

Replace sinceMaster with since in the docs of get-release-plan

⚠️ No Changeset found

Latest commit: b368641e23263f22f32a0b1b4607f395f7601c88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

<details><summary>This PR includes no changesets</summary>

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

Click here to learn what changesets are, and how to add one.

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

Andarist

comment created time in 41 minutes

push eventredux-saga/redux-saga

Archil Karchava

commit sha d4726a8b07f8790ab2b5ebd67bc9917f2a5ecf4e

Fixed typo (#2136)

view details

github-actions[bot]

commit sha aeb5125f00ed056a6469d170caefa548cd197fa6

Version Packages

view details

push time in an hour

Pull request review commentdavidkpiano/xstate

[xstate] Actor typing improvements

 import { useState, useRef } from 'react'; import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';-import { Sender, ActorRefLike } from './types';-import { EventObject, Actor } from 'xstate';+import { Sender } from './types';+import { ActorRef, EventObject } from 'xstate'; import useConstant from './useConstant'; -export function useActor<TEvent extends EventObject, TEmitted = any>(-  actorRef: ActorRefLike<TEvent, TEmitted> | Actor,-  getSnapshot: (actor: typeof actorRef) => TEmitted = (a) =>-    'state' in a ? a.state : (undefined as any)+function isActorWithState<T extends ActorRef<any>>(+  actorRef: T+): actorRef is T & { state: any } {+  return 'state' in actorRef;+}++function isDeferredActor<T extends ActorRef<any>>(+  actorRef: T+): actorRef is T & { deferred: boolean } {+  return 'deferred' in actorRef;+}++export function useActor<

In that case, I think it might be better to have the full actor as the first generic type param:

declare function useActor<
  TActor extends ActorRef<any, any> = ActorRef<any, any>
>(
  actorRef: TActor,
  getSnapshot?: (actor: TActor) => TActor extends ActorRef<any, infer TEmitted> ? TEmitted : never
): [TActor extends ActorRef<any, infer TEmitted> ? TEmitted : never, (event: TActor extends ActorRef<infer TEvent, any> ? TEvent : never) => void]

declare const aaa: ActorRef<{ type: 'foo' }, number>

const [state, send] = useActor(aaa)

TS Playground

I propose to make the second argument a regular value that has be given upfront - and if it's not then we can try to access actorRef.state.

No, we shouldn't assume that actorRef.state exists; remember, you didn't want ActorRef to be too loose re: { send: ..., [key: string]: any }.

davidkpiano

comment created time in 2 hours

issue commentdavidkpiano/xstate

TypeScript compilation error in @xstate/react/lib/fsm.d.ts

@davidkpiano I've just checked the bug:

  • it is reproducible for the versions mentioned above
  • it compiles correctly starting with version 1.0.0 of @xstate/react

I think the bug should be closed. Recommended solution: update version of @xstate/react

lukekarrys

comment created time in 4 hours

pull request commentemotion-js/emotion

Fix `css` prop missing from props types in TypeScript

I see I failed tests on CircleCi. I'll take a look at it in a moment.

hasparus

comment created time in 4 hours

pull request commentemotion-js/emotion

Fix `css` prop missing from props types in TypeScript

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b3957574c703a718d958a94a580757254d717db2:

Sandbox Source
Emotion Configuration
hasparus

comment created time in 4 hours

pull request commentemotion-js/emotion

Fix `css` prop missing from props types in TypeScript

⚠️ No Changeset found

Latest commit: ceeb227afe1bfde28ae522f518016ef469dc671c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

<details><summary>This PR includes no changesets</summary>

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

Click here to learn what changesets are, and how to add one.

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

hasparus

comment created time in 5 hours

PR opened emotion-js/emotion

Fix `css` prop missing from props types in TypeScript

<!-- Thanks for your interest in the project. I appreciate bugs filed and PRs submitted!

Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file).

Also, please make sure you're familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file).

If you're new to contributing to open source projects, you might find this free video course helpful: http://kcd.im/pull-request

Please fill out the information below to expedite the review and (hopefully) merge of your pull request! -->

<!-- What changes are being made? (What feature/bug is being fixed here?) -->

What:

Sup folks. I fixed one small problem with WithConditionalCSSProp.

I was actually fixing the same thing in another library https://github.com/system-ui/theme-ui/issues/1307. I accidentaly auto-imported WithConditionalCSSProp instead of WithConditionalSxProps while writing tests, and I noticed you have exactly the same problem :D

Why:

css prop is not added to all props types which accept className of type string, and it's also added to props which accept className?: undefined.

Take a look at this TS Playground.

How:

We can read extends as is assignable to or is subset of. We need to add css prop to all props objects that can accept className prop of type string, so

  • if { className: string } is assignable to P
  • or if we think of sets, if a set of all objects that have className property of type string is a subset of set P.

Checklist:

<!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->

  • [ ] Documentation N/A
  • [x] Tests
  • [x] Code complete
  • [ ] Changeset node-gyp failed with a hideous C++ error when I was installing node_modules, I'd need some more time write a changeset :cry:. Sorry! -->

<!-- feel free to add additional comments

+38 -6

0 comment

2 changed files

pr created time in 5 hours

Pull request review commentatlassian/changesets

Automatically deepen clones to find correct commits

 export async function getDivergedCommit(cwd: string, ref: string) {   return cmd.stdout.toString().trim(); } +/**+ * Get the short SHA for the commit that added a file, including automatically+ * extending a shallow clone if necessary to determine the commit.+ */ async function getCommitThatAddsFile(gitPath: string, cwd: string) {-  const gitCmd = await spawn(-    "git",-    ["log", "--diff-filter=A", "--max-count=1", "--pretty=format:%h", gitPath],-    { cwd }-  );-  return gitCmd.stdout.toString();+  do {+    const { commitSha, parentSha } = await findCommitAndParent();+    if (parentSha) {+      // We have found the parent of the commit that added the file.+      // Therefore we know that the commit is legitimate and isn't simply the boundary of a shallow clone.+      return commitSha;+    }++    // The commit we've found may be the real commit or it may be the boundary of+    // a shallow clone.++    // Can we deepen the clone?+    if (await isRepoShallow()) {+      // Yes.+      await deepenCloneBy(50);+    } else {+      // It's not a shallow clone, so the commit SHA we have is legitimate.+      return commitSha;+    }+  } while (true);++  /** Find the commit that added a file, and the parent of that commit */+  async function findCommitAndParent() {+    const logResult = await spawn(+      "git",+      [+        "log",+        "--diff-filter=A",+        "--max-count=1",+        "--pretty=format:%h:%p",+        gitPath+      ],+      { cwd }+    );+    const [commitSha, parentSha] = logResult.stdout.toString().split(":");+    return { commitSha, parentSha };+  }++  async function isRepoShallow() {+    const isShallowResult = await spawn(+      "git",+      ["rev-parse", "--is-shallow-repository"],+      { cwd }+    );+    return isShallowResult.stdout.toString().trim() === "true";+  }++  async function deepenCloneBy(by: number) {

Yes, testing such a beast fully would require some rather evil mocking and, as you say, be rather fragile and tied to implementation.

The single-writer approach would be some sort of mutex where as many things that want to read from the repo would be able to take 'read locks' as you like, but only one thing at a time can take a 'write lock' which blocks out readers until done. Easy to make correct, but avoiding the multiple unnecessary deepenings would require some complex code.

A new function that accepts a simple list and can take control of its own scheduling would be far simpler and more self-contained rather than having this specific git function having to know that it's being accessed in a parallel way and cope with that. i.e. the loop would be "Try to find commits for all files. Any of them need a deepening? Ok, we'll do one, then repeat."

The only other use seems to be in the apply-release-plan test-utils: https://github.com/atlassian/changesets/blob/c6d38b579bdfddc22714c352c3459d04d1745326/packages/apply-release-plan/src/test-utils/get-changelog-entry-with-git-hash.ts#L8-L16

Ok, so I'll look into changing getCommitThatAddsFile so it's a bulk operation. As we would want to encourage people to use the single bulk operation rather than looping, it probably makes sense to remove the existing one-at-a-time function, but that would be a breaking change in the git package. Let me know if that's not what you want.

RoystonS

comment created time in 6 hours

issue openedatlassian/changesets

`changeset status` errors when no publishable package has been modified

Affected Packages

@changesets/cli

Problem

Hello and thank you for changesets! It looks great and I'm excited to adopt it where I work 🙂 I'm migrating our versioning/publishing automation from rush to changesets, and changesets is a much lighter solution for my goals.

The only thing I miss from rush is their equivalent of changeset status, rush change -v. It automatically detects if any changes in your working branch actually affect a publishable package before erroring. That means if I have a branch that only makes changes to i.e. monorepo tooling, rush change -v does not error.

TL;DR; if I modify e.g. the root package.json of a monorepo and run changeset status --since=main, it will error, even though I didn't modify any publishable packages.

Proposed solution

It looks like currently, changeset status --since=branch only checks for new changeset files in .changeset/ to determine if it should error.

Ideally, it would also check if the diff since branch includes changes to files within packages folders before erroring.

created time in 6 hours

Pull request review commentatlassian/changesets

Automatically deepen clones to find correct commits

 export async function getDivergedCommit(cwd: string, ref: string) {   return cmd.stdout.toString().trim(); } +/**+ * Get the short SHA for the commit that added a file, including automatically+ * extending a shallow clone if necessary to determine the commit.+ */ async function getCommitThatAddsFile(gitPath: string, cwd: string) {-  const gitCmd = await spawn(-    "git",-    ["log", "--diff-filter=A", "--max-count=1", "--pretty=format:%h", gitPath],-    { cwd }-  );-  return gitCmd.stdout.toString();+  do {+    const { commitSha, parentSha } = await findCommitAndParent();+    if (parentSha) {+      // We have found the parent of the commit that added the file.+      // Therefore we know that the commit is legitimate and isn't simply the boundary of a shallow clone.+      return commitSha;+    }++    // The commit we've found may be the real commit or it may be the boundary of+    // a shallow clone.++    // Can we deepen the clone?+    if (await isRepoShallow()) {+      // Yes.+      await deepenCloneBy(50);+    } else {+      // It's not a shallow clone, so the commit SHA we have is legitimate.+      return commitSha;+    }+  } while (true);++  /** Find the commit that added a file, and the parent of that commit */+  async function findCommitAndParent() {+    const logResult = await spawn(+      "git",+      [+        "log",+        "--diff-filter=A",+        "--max-count=1",+        "--pretty=format:%h:%p",+        gitPath+      ],+      { cwd }+    );+    const [commitSha, parentSha] = logResult.stdout.toString().split(":");+    return { commitSha, parentSha };+  }++  async function isRepoShallow() {+    const isShallowResult = await spawn(+      "git",+      ["rev-parse", "--is-shallow-repository"],+      { cwd }+    );+    return isShallowResult.stdout.toString().trim() === "true";+  }++  async function deepenCloneBy(by: number) {

Very good call - I hadn't appreciated the parallel usage. Ok, so we need to avoid two things:

  1. Multiple parallel calls unnecessarily each deepening a clone. (5 changesets not in the current clone shouldn't cause us to run 5x50-commit-deepen calls.)
  2. Multiple parallel calls doing anything to a repo (specifically the git log --diff-filter) whilst one call is deepening it. (Don't read a repo whilst writing to it.)

I'll add a (per-repo) mutex that allows multiple readers OR a single writer.

Testing the multiple parallel job behaviour will be an "interesting challenge".

RoystonS

comment created time in 7 hours

Pull request review commentatlassian/changesets

Automatically deepen clones to find correct commits

 describe("git", () => {     it("should commit a file and get the hash of that commit", async () => {       await add("packages/pkg-b/package.json", cwd);       await commit("added packageB package.json", cwd);-      const head = await spawn("git", ["rev-parse", "--short", "HEAD"], {-        cwd-      });+      const headSha = await getCurrentCommitShort(cwd);        const commitHash = await getCommitThatAddsFile(         "packages/pkg-b/package.json",         cwd       ); -      expect(commitHash).toEqual(head.stdout.toString().trim());+      expect(commitHash).toEqual(headSha);+    });++    describe("with shallow clone", () => {+      // We will add these three well-known files+      // over multiple commits, then test looking up+      // the commits at which they were added.+      const file1 = ".changeset/quick-lions-devour.md";+      const file2 = "packages/pkg-a/index.js";+      const file3 = "packages/pkg-b/index.js";++      // The location of our cloned repo+      let clone: string;+      // The SHAs of the three interesting commits+      let commit1: string, commit2: string, commit3: string;++      async function createCommits(count: number, dir: string) {+        for (let i = 0; i < count; i++) {+          await commit("dummy commit", dir);+        }+      }++      beforeEach(async () => {

Ok. I'll see if I can pull out common helpers instead of a full common beforeEach.

RoystonS

comment created time in 7 hours

startedAndarist/react-textarea-autosize

started time in 10 hours

startedloreanvictor/callbag-common

started time in 13 hours

startedssbc/ssb-private1

started time in 14 hours

issue openedredux-saga/redux-saga

Get all currently running forks from running saga

<!--- Thanks for reporting!

Search open/closed issues before submitting since someone might have asked the same thing before! https://github.com/redux-saga/redux-saga/issues

If you have a question there is a chance that it was already answered on StackOverflow: https://stackoverflow.com/questions/tagged/redux-saga -->

Description

Hi! This has been bugging me out for a while and I'm thinking there must be some reasonable way to deal with it. Thanks for helping out!

Let's say I have this:

function* main() {
   yield* multiple()

  yield take("someCondition")
  return "somevalue"
}

function* multiple() {
   yield fork(someOtherLongRunningFunction)
   yield fork(someThirdEverLastingFunction)
}

When "someCondition" type has been submitted the "somevalue" should be returned. For this to happen the forks first need to be cancelled. Is there some way I can query ReduxSaga for a list of currently running forks?

The example is trivial, and I'm aware I could wrap the whole thing in a fork and then cancel that single fork. However, my real-world case is much more complex. There are multiple running forks, started in multiple places, and keeping track of all the forks is getting messy.

Note: I only want to cancel all subforks, not the currently running saga itself (because that would also cancel the parent which is waiting for the result to be returned).

created time in 14 hours

delete branch livechat/lc-sdk-go

delete branch : pass-ctx-webhook-v3.3

delete time in 16 hours

push eventlivechat/lc-sdk-go

Paweł Litwinowicz

commit sha 06e9b6e1d6ef1123cfe13eb9879fe8c9722b3644

Allow to forward ctx in webhook handlers (#46)

view details

push time in 16 hours

issue commentemotion-js/emotion

@emotion/jest - Snapshot serializer is not replacing hashes

to be clearer, it's not about emotion version, but @emotion/jest package. It is enough to downgrade to jest-emotion v.10 and snapshots are without hashes (and lot more readable)

ejdzipi

comment created time in 16 hours

issue commentemotion-js/emotion

@emotion/jest - Snapshot serializer is not replacing hashes

I would prefer, if it worked like before we upgraded from emotion 10 to v.11.

<details> <summary>Snapshot with before upgrading emotion</summary>

// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`StyleArrayComponent enzyme - snapshot 1`] = `
.emotion-1 {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}

.emotion-0 {
  background-color: black;
  color: white;
}

<_default>
  <div
    className="emotion-1"
  >
    Test content
    <div
      className="emotion-0"
    />
  </div>
</_default>
`;

</details>

I prepared also repro showing old behavior: https://github.com/ejdzipi/emotion10-jest-serializer-repro

ejdzipi

comment created time in 16 hours

push eventkentcdodds/react-toggled

Andrew Mason

commit sha 36b406ab7f0c79f4cbf9c55e7c574e2b05318fd5

docs: remove CodeFund sponsor (#32) CodeFund is not allowed to place ads on README's anymore according to GitHub

view details

push time in 20 hours

PR merged kentcdodds/react-toggled

docs: remove CodeFund sponsor

What:

Remove CodeFund sponsor ad from the README

Why:

CodeFund is not allowed to place ads on README's anymore according to GitHub. Please reach out to our team if you have any questions :slightly_smiling_face:

How:

Remove code from the top of the README

Checklist:

  • [x] Documentation
  • [ ] Tests N/A
  • [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
  • [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->
+0 -6

0 comment

1 changed file

andrewmcodes

pr closed time in 20 hours

pull request commentdavidkpiano/xstate

Increased width for visualizer img in docs

⚠️ No Changeset found

Latest commit: 93c31e13c0a8a91abb4a5df84a0dfe3f3f06f6f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

sidiousvic

comment created time in a day

PR opened davidkpiano/xstate

Increased width for visualizer img in docs

Not sure if targeting the right base repo.

Small change. The visualizer image was hard to see at such a small resolution.

(It's also outdated—tried to make a new one, but realized it might have to be hosted on designated Imgur account)

Great work with XState!

+1 -1

0 comment

1 changed file

pr created time in a day

pull request commentatlassian/changesets

Automatically deepen clones to find correct commits

(CLA requires some checking. Should be done soon.)

Note that I've hardwired the auto-deepening at 50 commits at a time. It would be possible to make this configurable, or make it increase (say, double) the number of commits deepened each time around the loop. But I'm not sure either are worthwhile. I'm imagining that one or two rounds of 50-deepening will cover the vast majority of scenarios.

RoystonS

comment created time in a day

pull request commentatlassian/changesets

Automatically deepen clones to find correct commits

🦋 Changeset detected

Latest commit: adefa9910409e6847388c3ed360cead27e2406e1

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

<details><summary>This PR includes changesets to release 1 package</summary>

Name Type
@changesets/git Minor

</details>

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

RoystonS

comment created time in a day

pull request commentatlassian/changesets

Automatically deepen clones to find correct commits

Thank you for your submission! Like many open source projects, we ask that you sign our <a href=https://opensource.atlassian.com/cla>CLA (Contributor License Agreement)</a> before we can accept your contribution. <strong>If your email is listed below</strong>, please ensure that you sign the CLA with the <strong>same email address</strong>.</br> <strong>The following users still need to sign our CLA:</strong></br>❌RoystonS <p><sub>Already signed the CLA? To re-check, try refreshing the page.</sub></p>

RoystonS

comment created time in a day

PR opened atlassian/changesets

Automatically deepen clones to find correct commits

This fixes #494 - where we would get the wrong commit that added a file if we were operating in a shallow repository that didn't contain the actual commit - by modifying getCommitThatAddsFile so that it automatically deepens a shallow clone until it finds the real commit that added a file.

+157 -10

0 comment

5 changed files

pr created time in a day

issue commentlivechat/react-native-livechat

Integrate live-chat to react native app through error

Please check: https://github.com/livechat/react-native-livechat/issues/84#issuecomment-734337699

snehasingh09

comment created time in a day

more