profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/mroch/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

mroch/ical_builder 8

An iCalendar generator in Ruby, modelled after Jim Weirich's Builder

mroch/bigmoney 6

Represents an amount of money in a particular currency. Backed by BigDecimal, so is safe from float rounding errors.

mroch/baby-connect 5

A library for interacting with Baby Connect

mroch/crestron-alexa-server 3

Simpl# Alexa server

mroch/attachment_fu 2

Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.

mroch/authpipe 2

Ruby library to respond to Courier authpipe authentication requests

mroch/campusbooks 2

A Ruby library for accessing the CampusBooks.com API

mroch/GzipSimplSharp 2

A Crestron Simpl# library to enable gzip decoding in SIMPL+

mroch/interlock 2

Evan Weaver's Rails plugin for maintainable and high-efficiency caching.

mroch/amazonian 1

Building out ASIN with the full Amazon Product Advertising API

created tagfacebook/watchman

tagv2021.06.14.00

Watches files and records, or triggers actions, when they change.

created time in an hour

push eventfacebook/watchman

Yedidya Feldblum

commit sha b7ab7e5a6c298aec6b1c3e9769b5c0115af8b047

migrate from LockedPtr::getUniqueLock Summary: The new name is `LockedPtr::as_lock`. Reviewed By: aary Differential Revision: D28987868 fbshipit-source-id: 8abd6a69a1b9c884adf137f06c24fe0df9ddd089

view details

push time in 7 hours

issue openedfacebook/watchman

brew install watchman is installing an invalid version

brew install watchman is installing an invalid version

Warning: Problem checking watchman version. Invalid Version: 2021.06.07.00.

Warning: watchman 2021.06.07.00 is already installed and up-to-date. To reinstall 2021.06.07.00, run: brew reinstall watchman

created time in 19 hours

Pull request review commentflow-typed/flow-typed

[semver_v7.x.x] add definitions

+// Generated from @types/semver using github.com/aminya/flowgen-package+declare module "semver" {+  import type semverParse from "semver/functions/parse"+  import type semverValid from "semver/functions/valid"+  import type semverClean from "semver/functions/clean"+  import type semverInc from "semver/functions/inc"+  import type semverDiff from "semver/functions/diff"+  import type semverMajor from "semver/functions/major"+  import type semverMinor from "semver/functions/minor"+  import type semverPatch from "semver/functions/patch"+  import type semverPrerelease from "semver/functions/prerelease"+  import type semverCompare from "semver/functions/compare"+  import type semverRcompare from "semver/functions/rcompare"+  import type semverCompareLoose from "semver/functions/compare-loose"+  import type semverCompareBuild from "semver/functions/compare-build"+  import type semverSort from "semver/functions/sort"+  import type semverRsort from "semver/functions/rsort"+  declare export {+    semverParse as parse,+    semverValid as valid,+    semverClean as clean,+    semverInc as inc,+    semverDiff as diff,+    semverMajor as major,+    semverMinor as minor,+    semverPatch as patch,+    semverPrerelease as prerelease,+    semverCompare as compare,+    semverRcompare as rcompare,+    semverCompareLoose as compareLoose,+    semverCompareBuild as compareBuild,+    semverSort as sort,+    semverRsort as rsort,+  };+  import type semverGt from "semver/functions/gt"+  import type semverLt from "semver/functions/lt"+  import type semverEq from "semver/functions/eq"+  import type semverNeq from "semver/functions/neq"+  import type semverGte from "semver/functions/gte"+  import type semverLte from "semver/functions/lte"+  import type semverCmp from "semver/functions/cmp"+  import type semverCoerce from "semver/functions/coerce"+  declare export {+    semverGt as gt,+    semverLt as lt,+    semverEq as eq,+    semverNeq as neq,+    semverGte as gte,+    semverLte as lte,+    semverCmp as cmp,+    semverCoerce as coerce,+  };+  import type semverSatisfies from "semver/functions/satisfies"+  import type semverMaxSatisfying from "semver/ranges/max-satisfying"+  import type semverMinSatisfying from "semver/ranges/min-satisfying"+  import type semverToComparators from "semver/ranges/to-comparators"+  import type semverMinVersion from "semver/ranges/min-version"+  import type semverValidRange from "semver/ranges/valid"+  import type semverOutside from "semver/ranges/outside"+  import type semverGtr from "semver/ranges/gtr"+  import type semverLtr from "semver/ranges/ltr"+  import type semverIntersects from "semver/ranges/intersects"+  import type simplify from "semver/ranges/simplify"+  import type rangeSubset from "semver/ranges/subset"+  declare export {+    semverSatisfies as satisfies,+    semverMaxSatisfying as maxSatisfying,+    semverMinSatisfying as minSatisfying,+    semverToComparators as toComparators,+    semverMinVersion as minVersion,+    semverValidRange as validRange,+    semverOutside as outside,+    semverGtr as gtr,+    semverLtr as ltr,+    semverIntersects as intersects,+    simplify as simplifyRange,+    rangeSubset as subset,+  };+  import type SemVer from "semver/classes/semver"+  import type Range from "semver/classes/range"+  import type Comparator from "semver/classes/comparator"+  declare export { SemVer, Range, Comparator };

The main issue here is that you shouldn't be importing semver/classes/semver as a type, import typeof SemVer from 'semver/classes/semver'; should be enough based on the type def of semver/classes/semver

aminya

comment created time in a day

Pull request review commentflow-typed/flow-typed

[semver_v7.x.x] add definitions

+// Generated from @types/semver using github.com/aminya/flowgen-package+declare module "semver" {+  import type * as semverParse from "semver/functions/parse"

Consider examples like the following for imports of types and vars import types: https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/redux-thunk_v2.x.x/flow_v0.83.x-/redux-thunk_v2.x.x.js#L23 import vars: https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/webpack_v5.x.x/flow_v0.104.x-/webpack_v5.x.x.js#L3

I believe the overall issue here is that you cannot import all named exports into a flow module, you need to specify all individual vars, and I think you didn't mean to import type because looking at your exports you're trying to export vars. Looking at what semver/functions/parse does I think you want something like

import typeof semverParse from 'semver/functions/parse';
aminya

comment created time in a day

issue commentfacebook/jscodeshift

Version: 0.12.0. /usr/bin/env: ‘node\r’: No such file or directory

Another workaround is to call the jscodeshift bin in node_modules directly, which bypass the shebang at the top of the script -

node node_modules/.bin/jscodeshift -t ...

This is useful if jscodeshift is being called as part of a script, and the package is installed separately or if it's not possible to use a different package manager

gavinxgu

comment created time in 2 days

Pull request review commentflow-typed/flow-typed

[semver_v7.x.x] add definitions

+// Generated from @types/semver using github.com/aminya/flowgen-package+declare module "semver" {+  import type * as semverParse from "semver/functions/parse"

What's the flow-typed compatible replacement?

I can't fix this if Flow doesn't support an alternative for this syntax.

aminya

comment created time in 2 days

push eventfacebook/watchman

Chad Austin

commit sha 393c851097876c24d47c898a5e20ff8412433457

increase audit query timeout to two minutes Summary: On CI, we're seeing some timeouts on large repositories during audit. Bump the default timeout to two minutes and add a configurable option. Reviewed By: genevievehelsel, singhsrb, kmancini Differential Revision: D29074358 fbshipit-source-id: a2ac848e7edf2efa672a835e71f75c79a91f2a09

view details

Chad Austin

commit sha aff2a0bf93e3606a2f4769a6829dc597cae3cff8

audit: include the version number in the query result Summary: It's helpful when looking at audit failures to know exactly which Watchman version was running at the time of the failure. Reviewed By: fanzeyi Differential Revision: D29080349 fbshipit-source-id: 53391d160d7daec51e5bd2b751c1774bcf91b00a

view details

push time in 2 days

push eventfacebook/flow

Sam Goldman

commit sha 5cfd922c3af5d3824ed84933952fd38d9d7a8a5a

Don't use file sig "with exports info" from insert type code action Summary: Right now file sig and type sig have a lot of overlap, and I'd like to consolidate them. The "exports info" data has only a few dependencies. It was originally introduced for types-first 1.0, but a few other places ended up using it. This is one of those places. Instead, we can use type sigs to implement the code here. IMO the resulting code is even quite a bit simpler. Reviewed By: vrama628 Differential Revision: D29053511 fbshipit-source-id: 976958e71d79b2ba1ef29d194921d909a7ec0fc1

view details

push time in 2 days

pull request commentflow-typed/flow-typed

update jest-dom toBeEmpty and toBeEmptyDOMElement matchers

@pascalduez The PR you mentioned didn't add toBeEmptyDOMElement to old versions. My PR adds it to all versions of flow/jest

ZigZagT

comment created time in 3 days

push eventfacebook/flow

Sam Goldman

commit sha a814f06a05be71468c7a4ea7676d4c75bec3816f

Add function to create ALoc.id from Locs.index Summary: ALoc.id is a special case of ALoc against which both concrete and keyed ALocs can be compared, given a reverse lookup table. See D18354373 (https://github.com/facebook/flow/commit/172800ffb60fdc29c6b23874f5b6775b75a3914a) for details. In a follow-up, I am going to identifiy exported locals from type signatures using this data type, to simplify the logic for detecting writes to exported locals. Reviewed By: panagosg7 Differential Revision: D29033874 fbshipit-source-id: b4096cc347fb42d919f9590b88b327d4dda9fda3

view details

Sam Goldman

commit sha 9e75c6ac3d5fc4b7ed49a88242f0d98e338d89f2

Change representation of exported locals Summary: Exported locals can be identified by their definition location alone, so it's not necessary to also store the name. This diff uses ALoc.id, which is a special case of ALoc that is always keyed. During check, we can use the reverse aloc table to find an ID for an aloc, either concrete or keyed. In a follow-up, I'm going to remove this set from the file sig and create it from the type sig during check instead. Reviewed By: panagosg7 Differential Revision: D29033875 fbshipit-source-id: ac65cc4f49bdcdace9cc7024d090334b5056f8e3

view details

Sam Goldman

commit sha c3b9858eaac1c0be79f44c333862f36a1d17a4c0

Get exported local information from type sigs Summary: Before this diff, the exported locals enviroment was stored in the file sig. Instead of storing it there, we can derive this information from the type sig during check. This saves a small amount of space in shared memory, but more importantly it removes a dependency on the file sig data, which I'm hoping to eliminate entirely. Reviewed By: dsainati1 Differential Revision: D29033870 fbshipit-source-id: c72da948931bb2f87d298244bd1be95e0ebc9e56

view details

push time in 3 days

push eventfacebook/flow

Sam Goldman

commit sha a7f7b291f5d26f080f329e85c860835bcbc51eb6

Add type sig to FindRefsUtils.ast_info tuple Summary: The ast_info tuple is used by find-refs and get-def in some places where it needs to call check_contents. In a follow-up, I am going to add type_sig as a parameter to that function. In preparation for that, I am adding the type_sig to this tuple, so we can pass it along. Reviewed By: panagosg7 Differential Revision: D29033871 fbshipit-source-id: 5c4066e8899ab9fc9c2d2ae1055f2133c09878c2

view details

push time in 3 days

push eventfacebook/flow

Ivan Babak

commit sha 894f757fb13af0041599ccafc02b4820e1112b84

[flowlib][dom] fix MediaSource readyState to match the spec "opened" -> "open" Summary: Flowlib DOM type for MediaSource.readyState was not up to spec, contained "opened" where it should say "open". The spec: https://w3c.github.io/media-source/#dom-readystate ``` enum ReadyState { "closed", "open", "ended" }; ``` Reviewed By: pieterv Differential Revision: D29046443 fbshipit-source-id: 21640e6e535779d4a5afe3ab8ccff4ea8fd3c693

view details

push time in 3 days

push eventfacebook/flow

Evan Yeung

commit sha 51e23acf691d9824f15750b227777a2354083d82

Flow codemod to remove existentials Summary: This is a codemod to remove the existential types from the codebase and replace them with the inferred types. It works by first trying to infer a type and using that. If there is any type of error, it will replace the existential with `mixed` or `any`. This will depend on whether the `--default-any` flag is passed in. Reviewed By: panagosg7 Differential Revision: D28855918 fbshipit-source-id: 80ec3fe41ab5ae430520db855e2588c1782d1eea

view details

push time in 3 days

push eventfacebook/flow

Sam Zhou

commit sha 817baa1426c0c98e7c1fa14f387a129ab242aec3

[lsp][extract] Inline `replace_statements_with_new_function_call` into `provide_available_refactor` Summary: The tests for these two functions are highly repetitive, so it's better to inline `replace_statements_with_new_function_call` into the main function and test once. In addition, `replace_statements_with_new_function_call` function contains a useful pattern matching on the location list. In the next diff, we will use the destructured location list to compute the union of all the statement locations only once. Reviewed By: vrama628 Differential Revision: D29050298 fbshipit-source-id: 0c2d89e728551ebf7479db9135f0dbe164e351d2

view details

Sam Zhou

commit sha 51af1ef001b20e286dc21a5db6135b0f3888e032

[lsp][extract] Compute the union of all extracted statements once inside `provide_available_refactor` Summary: This diff extracts the code to compute the union of all statements to `provide_available_refactor`. In the next diff where we compute the locations of other scopes to insert function definitions, we will use this computed location union Reviewed By: vrama628 Differential Revision: D29050299 fbshipit-source-id: 14fcb4b198fd61f90fbbd21920f1496b399db697

view details

Sam Zhou

commit sha 9d04504251f01ca7ca1a65dac91b46180b01e6d1

[lsp][extract] Change `provide_available_refactor` to return a list of available refactors Summary: This is a preparation diff to keep the next diff small and reviewable. In the next diff, I will make `provide_available_refactors` return refactors that insert function definitions into other scopes as well, so I will first change the types and all the uses in this diff. Reviewed By: vrama628 Differential Revision: D29050297 fbshipit-source-id: b67014d78d7c795e1fffd97e5c2d63ec86d9aca1

view details

Sam Zhou

commit sha 4ad333ba746f90d8fff84f183bcd6b13e434ef21

[lsp][extract] Generate extract function refactors for every named function that contains extracted statements Summary: We first make a pass over the AST to find all the named functions that contains the extracted statements. Then in the second pass, for each function, we insert the `newFunction` declaration to the end of the function body block. The name of the refactors will be `Extract to inner function in function '%s'`, which matches the current TypeScript language service behavior. Reviewed By: vrama628 Differential Revision: D29050296 fbshipit-source-id: 5f95415a52167be424c1186d958f2146692406f6

view details

push time in 3 days

push eventfacebook/flow

Sam Goldman

commit sha 44c423811f5dfeb46c733ddaab78ce4d48b08c2c

Add type sig to parse artifacts cache Summary: The parse artifacts cache is used as input to typecheck_contents. In a follow-up, I am going to add type_sig as an input to that function. We already produce a type sig during parsing. This change simply adds it to the cache, so we can pass it along. My immediate goal is to produce the exported_locals environment from type sigs instead of file sigs. Longer term, my aim is to replace file sigs with type sigs entirely, since they have a lot of overlap. Reviewed By: dsainati1 Differential Revision: D29033872 fbshipit-source-id: eab06514320b76615d991c2b6e46e0d13f0c6485

view details

push time in 3 days

push eventfacebook/flow

Sam Goldman

commit sha 0734fa4317da9d8d82386d1e270ed98ea75ac604

Add get_type_sig function to Parsing_heaps Summary: Before this change, there was only an unsafe variant, which we called when we knew that a type sig was certainly present. Adding for use in a follow-up diff, where this is not always the case. Reviewed By: dsainati1 Differential Revision: D29033873 fbshipit-source-id: f895d8a1f205b36018ed5f5c71dc3585cf46080d

view details

push time in 3 days

pull request commentflow-typed/flow-typed

update jest-dom toBeEmpty and toBeEmptyDOMElement matchers

Again, toBeEmptyDOMElement was added in #4083. So this MR should only be about adding the deprecation notice to toBeEmpty.

ZigZagT

comment created time in 3 days

push eventfacebook/flow

Daniel Sainati

commit sha 51c570286482858d75d2b6e3afd7a9269a63ee3e

fix error positioning issue with type application use_ops Summary: The example program added to the test below was causing a `prop-missing` type error to be located on the definition of `forEach` in `Map`. See https://flow.org/try/#0CYUwxgNghgTiAEkoGdnwLJQA4B4BqAfPAN4BQ8F8AZgPYwCiUYAFjgBoEAUYUEEARkwDWVAHYAueJwC22SZlyEAlPAC8RaQEsAHiGBLJANxqbgAbnKUA5iAAunA-DzwAPvGOmLleMjudDvACuIJJ4jgr4BBYAvqRxATDwVjA0gVh6ACJQtlBq8KIgAO4Y2A4WpAlJKWl5yanpwFk5AHQ29krldWnNWIHIzJwARIMdcaRdDU1QzbQMTAMy2CrqJJYUsljNvvYADKPRo2OkQA in version 0.152.0 to see what this looks like. In practice, since this definition of `Map` is pulled from the libdefs, this can result in a type error that is located in library definitions, which will can crash Flow's error printer. This is a result of some changes that were made to `flow_use_op` as part of the `134` release; which standardized how `use_op`s were selected to no longer be dependent on control flow. However, in this instance the logic for `pick_use_op` resulted in us never replacing `TypeApplication` `use_op`s, which should never be primary locations for errors when they result from unification. This adds another override so that the `FunCall` use_op can take precedence over the instantiation in this example. Reviewed By: jbrown215 Differential Revision: D29041393 fbshipit-source-id: 9ae14d37a7ec973456e54c7973932a0a120ee839

view details

push time in 3 days

pull request commentflow-typed/flow-typed

update jest-dom toBeEmpty and toBeEmptyDOMElement matchers

@pascalduez updated!

For deprecation of toBeEmpty:

Note: This matcher is being deprecated due to a name clash with jest-extended. See more info in 216. In the future, please use only: toBeEmptyDOMElement

Link in the description above.

ZigZagT

comment created time in 3 days

push eventfacebook/flow

Sam Zhou

commit sha 9f5b4a545ea8e8867cc693daf4a58377ae77514f

[ast-differ] Coalesce `Replace` and `Delete` AST diff into a single Replace diff spanning both replace and delete Summary: This diff adds a special case to `edits_of_changes` similar to the existing insert after replace case. In this case, we will coalesce a replace and delete into a single replace spanning both, given that the `new_statement`'s location is a union of both. For example: `replace(L1, 'foo();', newFunction()), delete(L2-L3, 'bar(); baz();')` will be come a single `replace(L1-L3, 'foo();', newFunction())`, if `newFunction()` has a loc of `L1-L3`. This is intended to support pretty-printing the diff without an extra empty line when we are replacing a list of consecutive statements into one statement. (Since the default behavior of `Delete` diff printing is to replace the original text with empty string) As far as I know, this should only affect the extract function refactor, which I specifically make the `newFunction()` call AST spans the location of all the original locations instead of giving it a dummy one. Reviewed By: vrama628 Differential Revision: D29002810 fbshipit-source-id: 938d46b2dc59119ddc6e978daffd344f0abe5471

view details

push time in 3 days

push eventfacebook/watchman

Chad Austin

commit sha 2f80886991ce81585ac0679c2b019fa0e4d9e9dd

comment why FSEventStreamFlushSync is necessary Summary: We have some confirmation FSEventStreamFlushSync is at least part of the story in fixing the incorrect query results on macOS. Encode in comments why. Reviewed By: xavierd Differential Revision: D29050360 fbshipit-source-id: 35ec005006ad251c31b7692922cce5322dadd3a2

view details

Chad Austin

commit sha 908701130f0d35ddbbcf27b7b8d3e40fb78f0064

implement flushPendingEvents for the mixed kqueue+fsevents watcher Summary: We have yet to receive confirmation that FSEventStreamFlushSync fixes all of the incorrect query results on macOS, but we found a repro in `hg split` that this fix addresses. With some confidence, apply the FSEventStreamFlushSync sync mechanism to the kqueue+fsevents watcher. Reviewed By: xavierd Differential Revision: D29050541 fbshipit-source-id: d0b27ab741051dbc8649314fafc1a6744e495ed5

view details

push time in 3 days

issue commentfacebook/flow

Annotation of `this` in function declarations

https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e

jussi-kalliokoski

comment created time in 3 days

pull request commentfacebook/flow

Add explicit `this` annotation syntax for function types

Sorry, this has been implemented: https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e

goodmind

comment created time in 3 days

pull request commentfacebook/flow

Add explicit `this` annotation syntax for function types

@gkz can you at least put a reason for the closure?

goodmind

comment created time in 3 days

issue commentfacebook/watchman

watchman-make not working on python3

@wez actually I now see that watchman-make is installed by the PyPI package here: https://pypi.org/project/pywatchman/

The PyPI record shows you as the publisher and that package does still contain the old code. Could you publish a newer version on PyPI?

schrockn

comment created time in 3 days

PR closed facebook/flow

Reviewers
Add explicit `this` annotation syntax for function types CLA Signed Experiment Typing: functions parsing

<!-- If this is a change to library defintions, please include links to relevant documentation. If this is a documentation change, please prefix the title with [DOCS].

If this is neither, ensure you opened a discussion issue and link it in the PR description. -->

Fixes #452 This implements it only for types and declares, doesn't work on statements and expressions

+314 -51

5 comments

32 changed files

goodmind

pr closed time in 3 days

push eventfacebook/flow

Sam Zhou

commit sha 13d2937771adfd036c8f629fd0c111be46f829e7

[lsp][extract] Combine `extract_statements` and `allow_refactor_extraction` Summary: This diff aims to slightly clear up the logic and improve the performance of extract function code action. Currently we are making two passes over the AST to decide whether extraction should be allowed: the first pass collects the statements to extract and the second pass computes the union of touched locations. When we use the check `union of touched locations == union of selected statements` to decide whether the selection contains partially selected statements, which should not be allowed. This two-pass approach is obviously less efficient than a one-pass approach. In addition, it is also unnecessary. All we need is to find whether there are partial selection of statements, which we can easily find simply by `Loc.intersects extract_range statement_loc` during the AST pass (assuming the contains case has been already checked, which is the case of the existing code). Therefore, in this diff, I merged the two visitor into one and make the `extract_statements` function return `None` to convey that extraction is not allowed. In the future, this visitor can be used to collect even more information during the visit: e.g. whether there is an await/yield, newly defined variables and used variables, etc Reviewed By: vrama628 Differential Revision: D29041210 fbshipit-source-id: ae55ca4f6d88b8c207b7e28094706effa746af1f

view details

push time in 3 days

issue closedfacebook/flow

Losing refinement with string literal union

Flow version: all

Expected behavior

When refining a type union of string literals the type of the refined variable should constrain to the refined values.

Actual behavior

After a refinement of the type union of string literals, Flow allows any string literal to be assigned to the refined type.

Note this only seems to happen when using a strict equals === comparison or a case 'literal' for refinement.

  • Link to Try-Flow or Github repo: https://flow.org/try/#0FAFwngDgpgBA8hEBLA9gOxgXhgcnVHGAH1xAHcVCScQALAJygIG5g2AzAVzQGNl0YUAB4BDALYQANlAAUKRKjQAueAvQBKFQn4YA3sBgwk7GHLUZMl0hRzqY+w4cYhO9DDQZMcrQwF8DpvI6WubqPjA86ADOIDAARiIAJioy4NAoJkGKdtg4gLwbgJU73gEyCcmqOmEBzq4YZay+QA

closed time in 3 days

beaucollins

issue commentfacebook/watchman

watchman-make not working on python3

I think you probably want to look at https://github.com/facebook/watchman/issues/851 which relates to getting homebrew on a more recent version of watchman

schrockn

comment created time in 3 days