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

Rename React hook useImperativeMethods -> useImperativeHandle #7352

Closed
wants to merge 1 commit into from

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jan 14, 2019

To stay in sync with the change made in facebook/react#14565

Disclaimer: These changes were manual and I'm going to let CI verify them. I'm having trouble actually building Flow locally and running tests. make fails with

hh_shared.c:1524:16: error: conflicting types for 'hh_collect'
CAMLprim value hh_collect(void) {
^
.../flow/_build/hack/heap/hh_shared.h:56:16: note: previous declaration is here
CAMLprim value hh_collect(value aggressive_val);
^
hh_shared.c:2670:16: error: conflicting types for 'hh_save_dep_table_sqlite'
CAMLprim value hh_save_dep_table_sqlite(
^
.../flow/_build/hack/heap/hh_shared.h:106:16: note: previous declaration is here
CAMLprim value hh_save_dep_table_sqlite(

@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 14, 2019

cc @jbrown215

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@jbrown215 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@jbrown215
Copy link
Contributor

I'll re-record the tests for you if necessary. This change is breaking and will error on projects that upgrade flow before they upgrade React. When will this name change be released? Should we support both for a few releases before removing useImperativeMethods?

@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 14, 2019

Big thanks man. (Any chance you know why yarn and make would be failing for me in master now? They worked okay a few weeks back.)

When will this name change be released?

We haven't committed to an exact release date for hooks yet, only "soon".

Should we support both for a few releases before removing useImperativeMethods?

Hooks haven't been released in anything stable yet (only a @next preview release) so we're good.

@jbrown215
Copy link
Contributor

Any chance you know why yarn and make would be failing for me in master now? They worked okay a few weeks back.

Just made a fresh clone and followed the setup instructions and Flow built for me using make ¯_(ツ)_/¯. I also ran yarn and everything was fine. circle builds also look like they passed on the latest commit.

@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 14, 2019

Gotcha. Hm...fresh clone+install fails for me as well (errors below). I've tried both Node 8.12 and 10.12

Not that we need to solve this here or anything 😁

$ yarn workspace flow-parser run prepublish
yarn workspace v1.12.1
yarn run v1.12.1
$ make js
if [ -e dist/flow_parser.js ]; then \
		[ flow_parser.js -nt dist/flow_parser.js ] || cp dist/flow_parser.js flow_parser.js; \
	else \
		/Applications/xcode_10_fb.app/Contents/Developer/usr/bin/make -C ../../src/parser js; \
		cp ../../src/parser/flow_parser.js flow_parser.js; \
	fi
libflowparser.h:10:10: fatal error: 'map' file not found
#include <map>
         ^~~~~
1 error generated.
libflowparser.h:10:10: fatal error: 'map' file not found
#include <map>
         ^~~~~
1 error generated.
cd /Users/bvaughn/Documents/git/flow/src/parser//../..; \
	ocamlbuild -use-ocamlfind -no-links -pkgs js_of_ocaml src/parser/flow_parser_dot_js.byte; \
	[ -e "src/parser/flow_parser.js" -a "src/parser/flow_parser.js" -nt "_build/src/parser/flow_parser_dot_js.byte" ] || \
		js_of_ocaml --opt 3 \
			-o src/parser/flow_parser.js \
			_build/src/parser/flow_parser_dot_js.byte
+ ocamlfind ocamlc -c -safe-string -w A -warn-error A -package core_kernel -package ppx_gen_rec -package ppx_deriving.show -package sedlex -package wtf8 -w -39 -w -4-6-29-35-44-48-50 -package ppx_deriving -package dtoa -package js_of_ocaml -I src/parser -o src/parser/flow_parser_js.cmo src/parser/flow_parser_js.ml
File "src/parser/flow_parser_js.ml", line 12, characters 11-24:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 16, characters 17-33:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 16, characters 35-44:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 17, characters 15-31:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 17, characters 33-40:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 18, characters 18-34:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 18, characters 36-49:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 19, characters 18-34:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 19, characters 36-44:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 20, characters 17-33:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 20, characters 35-53:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 21, characters 13-29:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 21, characters 30-37:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 24, characters 6-23:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 24, characters 25-43:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 34, characters 6-23:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 34, characters 25-43:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 39, characters 4-20:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 52, characters 19-32:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 53, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 54, characters 45-55:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 57, characters 30-43:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 58, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 59, characters 56-66:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 62, characters 28-41:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 63, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 64, characters 54-64:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 67, characters 23-36:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 68, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 69, characters 49-59:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 72, characters 26-39:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 73, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 74, characters 52-62:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 77, characters 27-40:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 78, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 79, characters 53-63:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 82, characters 14-27:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 83, characters 16-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 84, characters 29-39:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 95, characters 17-29:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 96, characters 9-22:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 99, characters 16-28:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 103, characters 17-30:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 104, characters 4-18:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 104, characters 29-39:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 120, characters 2-15:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 121, characters 25-38:
Warning 3: deprecated: module Js
Will be removed past 2019-01-01. Use Js_of_ocaml.Js instead.
File "src/parser/flow_parser_js.ml", line 1:
Error: Some fatal warnings were triggered (47 occurrences)
Command exited with code 2.
Compilation unsuccessful after building 51 targets (50 cached) in 00:00:01.
js_of_ocaml: Error: Sys_error("_build/src/parser/flow_parser_dot_js.byte: No such file or directory")
make[1]: *** [js] Error 1
cp: ../../src/parser/flow_parser.js: No such file or directory
make: *** [flow_parser.js] Error 1
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /Users/bvaughn/.nvm/versions/node/v8.12.0/bin/node
Arguments: /opt/facebook/fb-kpm/lib/cli.js run prepublish
Directory: /Users/bvaughn/Documents/git/flow/packages/flow-parser
Output:

@nmote nmote added the Library definitions Issues or pull requests about core library definitions label Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Library definitions Issues or pull requests about core library definitions Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants