Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

Conversation

@philikon
Copy link
Contributor

@philikon philikon commented Jul 6, 2015

A bunch of atomic commits (each one leaves Flow checks and unit tests passing as they were) that fix some variable naming, code readability and cleanliness issues, as well as provide a bunch of Flow type annotations.

The frequent use of any throughout the codebase is currently shadowing a bunch of missing type declarations, as well as violations of existing type declarations. I'd like to start un-shadowing those and fixing up the call-sites one by one. I'm fairly certain that in the end we'll have a cleaner codebase, and we might even find some bugs in the process. Either way, having Flow be able to reason about the entire codebase should help us find bugs going forward.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was written before Flow got support for export and export default. We can probably just use those inline, now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly Flow doesn't like mixing export (ES6) and module.exports (CommonJS), and ES6 modules don't allow conditional exports, it seems...

philikon added 6 commits July 6, 2015 19:17
The code is sufficiently different, and it got really hard to read. Plus, Flow was (well, should've been, and will, after we fix some other things) about uninitialized variables because not all codepaths hit them
…ectStore and MutationExecutor

Using 'any' at that level masks much of the type checking inside the module, which prevents us from catching bugs via Flow.

Two more modules are doing this, QueryTools and SubscriptionManager, but removing 'any' there will require updating a bunch of Flow type declarations and fixing code that currently doesn't get checked, so let's save those for later.
andrewimm added a commit that referenced this pull request Jul 7, 2015
Refactor and improve Flow typing
@andrewimm andrewimm merged commit 5e062d4 into parse-community:master Jul 7, 2015
@philikon philikon deleted the refactoring branch July 8, 2015 20:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants