Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions analysis/src/jsx_hacks.ml

This file was deleted.

2 changes: 1 addition & 1 deletion analysis/src/process_cmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ let rec for_structure_item ~(env : Shared_types.Env.t) ~(exported : Exported.t)
incl_type []
in
top_level
| Tstr_primitive vd when Jsx_hacks.primitive_is_fragment vd = false ->
| Tstr_primitive vd ->
let declared =
add_declared ~extent:vd.val_loc ~item:vd.val_val.val_type
~name:vd.val_name
Expand Down
3 changes: 1 addition & 2 deletions analysis/src/process_extra.ml
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ let pat ~(file : File.t) ~env ~extra (iter : Tast_iterator.iterator)
let expr ~env ~(extra : extra) (iter : Tast_iterator.iterator)
(expression : Typedtree.expression) =
(match expression.exp_desc with
| Texp_ident (path, {txt; loc}, _) when not (Jsx_hacks.path_is_fragment path)
->
| Texp_ident (path, {txt; loc}, _) ->
add_for_longident ~env ~extra
(Some (expression.exp_type, Value))
path txt loc
Expand Down
21 changes: 0 additions & 21 deletions analysis/src/references.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,6 @@ let get_loc_item ~full ~pos ~debug =
| _ -> "NotFound"
in
match loc_items with
| li1 :: li2 :: li3 :: ({loc_type = Typed ("makeProps", _, _)} as li4) :: _
when full.file.uri |> Uri.is_interface ->
log 1 "heuristic for makeProps in interface files";
if debug then
Printf.printf "n1:%s n2:%s n3:%s\n" (name_of li1) (name_of li2)
(name_of li3);
Some li4
| [
{loc_type = Constant _};
({loc_type = Typed ("createDOMElementVariadic", _, _)} as li2);
] ->
log 3 "heuristic for <div>";
Some li2
| {loc_type = Typed ("makeProps", _, _)}
:: ({loc_type = Typed ("make", _, _)} as li2)
:: _ ->
log 4
"heuristic for </Comp> within fragments: take make as makeProps does not \
work\n\
the type is not great but jump to definition works";
Some li2
| [
({loc_type = Typed (_, _, LocalReference _)} as li1);
({loc_type = Typed (_, _, _)} as li2);
Expand Down
1 change: 1 addition & 0 deletions changes/remove-reason-react-leftovers.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove ReasonReact and JSX v3 leftovers from editor analysis and genType.
2 changes: 1 addition & 1 deletion compiler/gentype/gentype_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ let process_cmt_file cmt =
let resolver =
Module_resolver.create_lazy_resolver ~config
~extensions:[".res"; ".shim.ts"] ~exclude_file:(fun fname ->
fname = "React.res" || fname = "ReasonReact.res")
fname = "React.res")
in
if has_gentype_annotations then
input_cmt
Expand Down
5 changes: 0 additions & 5 deletions compiler/gentype/translate_type_expr_from_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,9 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env =
{dependencies = []; type_ = Emit_type.type_react_dom_re_dom_ref}
| ["ReactDOM"; "Ref"; "currentDomRef"], [] ->
{dependencies = []; type_ = Emit_type.type_any}
| ["ReactDOMRe"; "domRef"], [] ->
{dependencies = []; type_ = Emit_type.type_react_dom_re_dom_ref}
| ["ReactDOMRe"; "Ref"; "currentDomRef"], [] ->
{dependencies = []; type_ = Emit_type.type_any}
| ["ReactEvent"; "Mouse"; "t"], [] ->
{dependencies = []; type_ = Emit_type.type_react_event_mouse_t}
| ( ( ["React"; "element"]
| ["ReasonReact"; "reactElement"]
| ["Pervasives"; "Jsx"; "element"]
| ["Jsx"; "element"] ),
[] ) ->
Expand Down
4 changes: 2 additions & 2 deletions compiler/gentype/translation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ let translate_value ~attributes ~config ~doc_string ~output_file_relative
}

(**
[@genType]
[@module] external myBanner : ReasonReact.reactClass = "./MyBanner";
@genType @module("./MyBanner")
external make: React.component<props> = "default"
*)
let translate_primitive ~config ~output_file_relative ~resolver ~type_env
(value_description : Typedtree.value_description) : t =
Expand Down
Loading