Conversation
Contributor
…ile (#1546) Summary: Currently, we have a smattering of `*.flow.js` files in Metro. These mean either of two things: 1) Modules that only export Flow types 2) Modules that are written in Flow, to distinguish them from a colocated plain JS file. Type 1) doesn't really have any significance and isn't enforced - we still build and publish (usually empty) `foo.flow.js` files and even accompanying `foo.flow.js.flow` files, and there's nothing to stop them containing runtime code (indeed, with enums, they do). The renames all files of type 1) to drop the `.flow`. This is a prerequisite for auto-generating TS types for Metro - by establishing and enforcing a convention that `foo.js` and `foo.flow.js` are a Babel-registering entry point and an implementation file respectively, we can teach the API generator that `foo.flow.js` should generate `foo.d.ts`, and `foo.js` should be ignored. Changelog: Internal Pull Request resolved: #1546 Test Plan: - Flow/CI Differential Revision: D79566838 Pulled By: robhogan
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D79566838 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, we have a smattering of
*.flow.jsfiles in Metro. These mean either of two things:Type 1) doesn't really have any significance and isn't enforced - we still build and publish (usually empty)
foo.flow.jsfiles and even accompanyingfoo.flow.js.flowfiles, and there's nothing to stop them containing runtime code (indeed, with enums, they do).The renames all files of type 1) to drop the
.flow.This is a prerequisite for auto-generating TS types for Metro - by establishing and enforcing a convention that
foo.jsandfoo.flow.jsare a Babel-registering entry point and an implementation file respectively, we can teach the API generator thatfoo.flow.jsshould generatefoo.d.ts, andfoo.jsshould be ignored.Changelog: Internal