From e583aeb61a0bbc6301e4405b501c9720737a539a Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Fri, 19 Jul 2024 16:17:25 +0200 Subject: [PATCH 1/2] Reunify JsxC/JsxU -> Jsx etc. --- jscomp/others/{jsxC.res => jsx.res} | 2 - jscomp/others/{jsxDOMC.res => jsxDOM.res} | 164 +++-- jscomp/others/jsxDOMU.res | 624 ------------------ jscomp/others/{jsxEventC.res => jsxEvent.res} | 2 - jscomp/others/jsxEventU.res | 350 ---------- ...actSupportC.res => jsxPPXReactSupport.res} | 2 - jscomp/others/jsxPPXReactSupportU.res | 54 -- jscomp/others/jsxU.res | 20 - jscomp/others/release.ninja | 14 +- jscomp/stdlib-406/pervasives.res | 11 - jscomp/stdlib-406/pervasives.resi | 13 - jscomp/test/ocaml_re_test.js | 314 ++++----- jscomp/test/test_pervasive.js | 5 - jscomp/test/test_pervasives2.js | 10 - jscomp/test/test_pervasives3.js | 5 - lib/es6/{jsxC.js => jsx.js} | 0 lib/es6/{jsxDOMC.js => jsxDOM.js} | 0 lib/es6/{jsxEventC.js => jsxEvent.js} | 0 lib/es6/jsxEventU.js | 59 -- ...ReactSupportC.js => jsxPPXReactSupport.js} | 3 - lib/es6/jsxPPXReactSupportU.js | 29 - lib/es6/pervasives.js | 19 - lib/{es6/jsxDOMU.js => js/jsx.js} | 0 lib/js/jsxC.js | 1 - lib/{es6/jsxU.js => js/jsxDOM.js} | 0 lib/js/jsxDOMC.js | 1 - lib/js/jsxDOMU.js | 1 - lib/js/{jsxEventC.js => jsxEvent.js} | 0 lib/js/jsxEventU.js | 57 -- ...ReactSupportU.js => jsxPPXReactSupport.js} | 3 - lib/js/jsxPPXReactSupportC.js | 27 - lib/js/jsxU.js | 1 - lib/js/pervasives.js | 19 - packages/artifacts.txt | 72 +- 34 files changed, 267 insertions(+), 1615 deletions(-) rename jscomp/others/{jsxC.res => jsx.res} (98%) rename jscomp/others/{jsxDOMC.res => jsxDOM.res} (80%) delete mode 100644 jscomp/others/jsxDOMU.res rename jscomp/others/{jsxEventC.res => jsxEvent.res} (99%) delete mode 100644 jscomp/others/jsxEventU.res rename jscomp/others/{jsxPPXReactSupportC.res => jsxPPXReactSupport.res} (99%) delete mode 100644 jscomp/others/jsxPPXReactSupportU.res delete mode 100644 jscomp/others/jsxU.res rename lib/es6/{jsxC.js => jsx.js} (100%) rename lib/es6/{jsxDOMC.js => jsxDOM.js} (100%) rename lib/es6/{jsxEventC.js => jsxEvent.js} (100%) delete mode 100644 lib/es6/jsxEventU.js rename lib/es6/{jsxPPXReactSupportC.js => jsxPPXReactSupport.js} (97%) delete mode 100644 lib/es6/jsxPPXReactSupportU.js rename lib/{es6/jsxDOMU.js => js/jsx.js} (100%) delete mode 100644 lib/js/jsxC.js rename lib/{es6/jsxU.js => js/jsxDOM.js} (100%) delete mode 100644 lib/js/jsxDOMC.js delete mode 100644 lib/js/jsxDOMU.js rename lib/js/{jsxEventC.js => jsxEvent.js} (100%) delete mode 100644 lib/js/jsxEventU.js rename lib/js/{jsxPPXReactSupportU.js => jsxPPXReactSupport.js} (95%) delete mode 100644 lib/js/jsxPPXReactSupportC.js delete mode 100644 lib/js/jsxU.js diff --git a/jscomp/others/jsxC.res b/jscomp/others/jsx.res similarity index 98% rename from jscomp/others/jsxC.res rename to jscomp/others/jsx.res index d7e08eb405..fd9735b9c1 100644 --- a/jscomp/others/jsxC.res +++ b/jscomp/others/jsx.res @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*** Internal: use Jsx directly. */ - type element type ref diff --git a/jscomp/others/jsxDOMC.res b/jscomp/others/jsxDOM.res similarity index 80% rename from jscomp/others/jsxDOMC.res rename to jscomp/others/jsxDOM.res index c1d709887b..595bf12965 100644 --- a/jscomp/others/jsxDOMC.res +++ b/jscomp/others/jsxDOM.res @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*** Internal: use JsxDOM directly. */ - type style = JsxDOMStyle.t type domRef @@ -32,7 +30,7 @@ type domRef */ type domProps = { key?: string, - children?: JsxC.element, + children?: Jsx.element, ref?: domRef, /* accessibility */ /* https://www.w3.org/TR/wai-aria-1.1/ */ @@ -262,100 +260,100 @@ type domProps = { width?: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, wrap?: string /* "hard" or "soft" */, /* Clipboard events */ - onCopy?: JsxEventC.Clipboard.t => unit, - onCut?: JsxEventC.Clipboard.t => unit, - onPaste?: JsxEventC.Clipboard.t => unit, + onCopy?: JsxEvent.Clipboard.t => unit, + onCut?: JsxEvent.Clipboard.t => unit, + onPaste?: JsxEvent.Clipboard.t => unit, /* Composition events */ - onCompositionEnd?: JsxEventC.Composition.t => unit, - onCompositionStart?: JsxEventC.Composition.t => unit, - onCompositionUpdate?: JsxEventC.Composition.t => unit, + onCompositionEnd?: JsxEvent.Composition.t => unit, + onCompositionStart?: JsxEvent.Composition.t => unit, + onCompositionUpdate?: JsxEvent.Composition.t => unit, /* Keyboard events */ - onKeyDown?: JsxEventC.Keyboard.t => unit, - onKeyPress?: JsxEventC.Keyboard.t => unit, - onKeyUp?: JsxEventC.Keyboard.t => unit, + onKeyDown?: JsxEvent.Keyboard.t => unit, + onKeyPress?: JsxEvent.Keyboard.t => unit, + onKeyUp?: JsxEvent.Keyboard.t => unit, /* Focus events */ - onFocus?: JsxEventC.Focus.t => unit, - onBlur?: JsxEventC.Focus.t => unit, + onFocus?: JsxEvent.Focus.t => unit, + onBlur?: JsxEvent.Focus.t => unit, /* Form events */ - onBeforeInput?: JsxEventC.Form.t => unit, - onChange?: JsxEventC.Form.t => unit, - onInput?: JsxEventC.Form.t => unit, - onReset?: JsxEventC.Form.t => unit, - onSubmit?: JsxEventC.Form.t => unit, - onInvalid?: JsxEventC.Form.t => unit, + onBeforeInput?: JsxEvent.Form.t => unit, + onChange?: JsxEvent.Form.t => unit, + onInput?: JsxEvent.Form.t => unit, + onReset?: JsxEvent.Form.t => unit, + onSubmit?: JsxEvent.Form.t => unit, + onInvalid?: JsxEvent.Form.t => unit, /* Mouse events */ - onClick?: JsxEventC.Mouse.t => unit, - onContextMenu?: JsxEventC.Mouse.t => unit, - onDoubleClick?: JsxEventC.Mouse.t => unit, - onDrag?: JsxEventC.Mouse.t => unit, - onDragEnd?: JsxEventC.Mouse.t => unit, - onDragEnter?: JsxEventC.Mouse.t => unit, - onDragExit?: JsxEventC.Mouse.t => unit, - onDragLeave?: JsxEventC.Mouse.t => unit, - onDragOver?: JsxEventC.Mouse.t => unit, - onDragStart?: JsxEventC.Mouse.t => unit, - onDrop?: JsxEventC.Mouse.t => unit, - onMouseDown?: JsxEventC.Mouse.t => unit, - onMouseEnter?: JsxEventC.Mouse.t => unit, - onMouseLeave?: JsxEventC.Mouse.t => unit, - onMouseMove?: JsxEventC.Mouse.t => unit, - onMouseOut?: JsxEventC.Mouse.t => unit, - onMouseOver?: JsxEventC.Mouse.t => unit, - onMouseUp?: JsxEventC.Mouse.t => unit, + onClick?: JsxEvent.Mouse.t => unit, + onContextMenu?: JsxEvent.Mouse.t => unit, + onDoubleClick?: JsxEvent.Mouse.t => unit, + onDrag?: JsxEvent.Mouse.t => unit, + onDragEnd?: JsxEvent.Mouse.t => unit, + onDragEnter?: JsxEvent.Mouse.t => unit, + onDragExit?: JsxEvent.Mouse.t => unit, + onDragLeave?: JsxEvent.Mouse.t => unit, + onDragOver?: JsxEvent.Mouse.t => unit, + onDragStart?: JsxEvent.Mouse.t => unit, + onDrop?: JsxEvent.Mouse.t => unit, + onMouseDown?: JsxEvent.Mouse.t => unit, + onMouseEnter?: JsxEvent.Mouse.t => unit, + onMouseLeave?: JsxEvent.Mouse.t => unit, + onMouseMove?: JsxEvent.Mouse.t => unit, + onMouseOut?: JsxEvent.Mouse.t => unit, + onMouseOver?: JsxEvent.Mouse.t => unit, + onMouseUp?: JsxEvent.Mouse.t => unit, /* Selection events */ - onSelect?: JsxEventC.Selection.t => unit, + onSelect?: JsxEvent.Selection.t => unit, /* Touch events */ - onTouchCancel?: JsxEventC.Touch.t => unit, - onTouchEnd?: JsxEventC.Touch.t => unit, - onTouchMove?: JsxEventC.Touch.t => unit, - onTouchStart?: JsxEventC.Touch.t => unit, + onTouchCancel?: JsxEvent.Touch.t => unit, + onTouchEnd?: JsxEvent.Touch.t => unit, + onTouchMove?: JsxEvent.Touch.t => unit, + onTouchStart?: JsxEvent.Touch.t => unit, // Pointer events - onPointerOver?: JsxEventC.Pointer.t => unit, - onPointerEnter?: JsxEventC.Pointer.t => unit, - onPointerDown?: JsxEventC.Pointer.t => unit, - onPointerMove?: JsxEventC.Pointer.t => unit, - onPointerUp?: JsxEventC.Pointer.t => unit, - onPointerCancel?: JsxEventC.Pointer.t => unit, - onPointerOut?: JsxEventC.Pointer.t => unit, - onPointerLeave?: JsxEventC.Pointer.t => unit, - onGotPointerCapture?: JsxEventC.Pointer.t => unit, - onLostPointerCapture?: JsxEventC.Pointer.t => unit, + onPointerOver?: JsxEvent.Pointer.t => unit, + onPointerEnter?: JsxEvent.Pointer.t => unit, + onPointerDown?: JsxEvent.Pointer.t => unit, + onPointerMove?: JsxEvent.Pointer.t => unit, + onPointerUp?: JsxEvent.Pointer.t => unit, + onPointerCancel?: JsxEvent.Pointer.t => unit, + onPointerOut?: JsxEvent.Pointer.t => unit, + onPointerLeave?: JsxEvent.Pointer.t => unit, + onGotPointerCapture?: JsxEvent.Pointer.t => unit, + onLostPointerCapture?: JsxEvent.Pointer.t => unit, /* UI events */ - onScroll?: JsxEventC.UI.t => unit, + onScroll?: JsxEvent.UI.t => unit, /* Wheel events */ - onWheel?: JsxEventC.Wheel.t => unit, + onWheel?: JsxEvent.Wheel.t => unit, /* Media events */ - onAbort?: JsxEventC.Media.t => unit, - onCanPlay?: JsxEventC.Media.t => unit, - onCanPlayThrough?: JsxEventC.Media.t => unit, - onDurationChange?: JsxEventC.Media.t => unit, - onEmptied?: JsxEventC.Media.t => unit, - onEncrypted?: JsxEventC.Media.t => unit, - onEnded?: JsxEventC.Media.t => unit, - onError?: JsxEventC.Media.t => unit, - onLoadedData?: JsxEventC.Media.t => unit, - onLoadedMetadata?: JsxEventC.Media.t => unit, - onLoadStart?: JsxEventC.Media.t => unit, - onPause?: JsxEventC.Media.t => unit, - onPlay?: JsxEventC.Media.t => unit, - onPlaying?: JsxEventC.Media.t => unit, - onProgress?: JsxEventC.Media.t => unit, - onRateChange?: JsxEventC.Media.t => unit, - onSeeked?: JsxEventC.Media.t => unit, - onSeeking?: JsxEventC.Media.t => unit, - onStalled?: JsxEventC.Media.t => unit, - onSuspend?: JsxEventC.Media.t => unit, - onTimeUpdate?: JsxEventC.Media.t => unit, - onVolumeChange?: JsxEventC.Media.t => unit, - onWaiting?: JsxEventC.Media.t => unit, + onAbort?: JsxEvent.Media.t => unit, + onCanPlay?: JsxEvent.Media.t => unit, + onCanPlayThrough?: JsxEvent.Media.t => unit, + onDurationChange?: JsxEvent.Media.t => unit, + onEmptied?: JsxEvent.Media.t => unit, + onEncrypted?: JsxEvent.Media.t => unit, + onEnded?: JsxEvent.Media.t => unit, + onError?: JsxEvent.Media.t => unit, + onLoadedData?: JsxEvent.Media.t => unit, + onLoadedMetadata?: JsxEvent.Media.t => unit, + onLoadStart?: JsxEvent.Media.t => unit, + onPause?: JsxEvent.Media.t => unit, + onPlay?: JsxEvent.Media.t => unit, + onPlaying?: JsxEvent.Media.t => unit, + onProgress?: JsxEvent.Media.t => unit, + onRateChange?: JsxEvent.Media.t => unit, + onSeeked?: JsxEvent.Media.t => unit, + onSeeking?: JsxEvent.Media.t => unit, + onStalled?: JsxEvent.Media.t => unit, + onSuspend?: JsxEvent.Media.t => unit, + onTimeUpdate?: JsxEvent.Media.t => unit, + onVolumeChange?: JsxEvent.Media.t => unit, + onWaiting?: JsxEvent.Media.t => unit, /* Image events */ - onLoad?: JsxEventC.Image.t => unit /* duplicate */ /* ~onError: ReactEvent.Image.t => unit=?, */, + onLoad?: JsxEvent.Image.t => unit /* duplicate */ /* ~onError: ReactEvent.Image.t => unit=?, */, /* Animation events */ - onAnimationStart?: JsxEventC.Animation.t => unit, - onAnimationEnd?: JsxEventC.Animation.t => unit, - onAnimationIteration?: JsxEventC.Animation.t => unit, + onAnimationStart?: JsxEvent.Animation.t => unit, + onAnimationEnd?: JsxEvent.Animation.t => unit, + onAnimationIteration?: JsxEvent.Animation.t => unit, /* Transition events */ - onTransitionEnd?: JsxEventC.Transition.t => unit, + onTransitionEnd?: JsxEvent.Transition.t => unit, /* svg */ accentHeight?: string, accumulate?: string, diff --git a/jscomp/others/jsxDOMU.res b/jscomp/others/jsxDOMU.res deleted file mode 100644 index a427376dc5..0000000000 --- a/jscomp/others/jsxDOMU.res +++ /dev/null @@ -1,624 +0,0 @@ -/* Copyright (C) 2022- Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/*** Internal: use JsxDOM directly. */ - -@@uncurried - -type style = JsxDOMStyle.t -type domRef - -/* - This list isn't exhaustive. We'll add more as we go. -*/ -type domProps = { - key?: string, - children?: JsxU.element, - ref?: domRef, - /* accessibility */ - /* https://www.w3.org/TR/wai-aria-1.1/ */ - /* https://accessibilityresources.org/ is a great resource for these */ - @as("aria-current") - ariaCurrent?: [#page | #step | #location | #date | #time | #"true" | #"false"], - @as("aria-details") - ariaDetails?: string, - @as("aria-disabled") - ariaDisabled?: bool, - @as("aria-hidden") - ariaHidden?: bool, - @as("aria-invalid") ariaInvalid?: [#grammar | #"false" | #spelling | #"true"], - @as("aria-keyshortcuts") - ariaKeyshortcuts?: string, - @as("aria-label") - ariaLabel?: string, - @as("aria-roledescription") - ariaRoledescription?: string, - /* Widget Attributes */ - @as("aria-autocomplete") ariaAutocomplete?: [#inline | #list | #both | #none], - /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ - @as("aria-checked") - ariaChecked?: [#"true" | #"false" | #mixed], - @as("aria-expanded") - ariaExpanded?: bool, - @as("aria-haspopup") - ariaHaspopup?: [#menu | #listbox | #tree | #grid | #dialog | #"true" | #"false"], - @as("aria-level") - ariaLevel?: int, - @as("aria-modal") - ariaModal?: bool, - @as("aria-multiline") - ariaMultiline?: bool, - @as("aria-multiselectable") - ariaMultiselectable?: bool, - @as("aria-orientation") ariaOrientation?: [#horizontal | #vertical | #undefined], - @as("aria-placeholder") - ariaPlaceholder?: string, - /* https://www.w3.org/TR/wai-aria-1.1/#valuetype_tristate */ - @as("aria-pressed") ariaPressed?: [#"true" | #"false" | #mixed], - @as("aria-readonly") - ariaReadonly?: bool, - @as("aria-required") - ariaRequired?: bool, - @as("aria-selected") - ariaSelected?: bool, - @as("aria-sort") - ariaSort?: string, - @as("aria-valuemax") - ariaValuemax?: float, - @as("aria-valuemin") - ariaValuemin?: float, - @as("aria-valuenow") - ariaValuenow?: float, - @as("aria-valuetext") - ariaValuetext?: string, - /* Live Region Attributes */ - @as("aria-atomic") - ariaAtomic?: bool, - @as("aria-busy") - ariaBusy?: bool, - @as("aria-live") ariaLive?: [#off | #polite | #assertive | #rude], - @as("aria-relevant") - ariaRelevant?: string, - /* Drag-and-Drop Attributes */ - @as("aria-dropeffect") ariaDropeffect?: [#copy | #move | #link | #execute | #popup | #none], - @as("aria-grabbed") - ariaGrabbed?: bool, - /* Relationship Attributes */ - @as("aria-activedescendant") - ariaActivedescendant?: string, - @as("aria-colcount") - ariaColcount?: int, - @as("aria-colindex") - ariaColindex?: int, - @as("aria-colspan") - ariaColspan?: int, - @as("aria-controls") - ariaControls?: string, - @as("aria-describedby") - ariaDescribedby?: string, - @as("aria-errormessage") - ariaErrormessage?: string, - @as("aria-flowto") - ariaFlowto?: string, - @as("aria-labelledby") - ariaLabelledby?: string, - @as("aria-owns") - ariaOwns?: string, - @as("aria-posinset") - ariaPosinset?: int, - @as("aria-rowcount") - ariaRowcount?: int, - @as("aria-rowindex") - ariaRowindex?: int, - @as("aria-rowspan") - ariaRowspan?: int, - @as("aria-setsize") - ariaSetsize?: int, - /* react textarea/input */ - defaultChecked?: bool, - defaultValue?: string, - /* global html attributes */ - accessKey?: string, - className?: string /* substitute for "class" */, - contentEditable?: bool, - contextMenu?: string, - @as("data-testid") dataTestId?: string, - dir?: string /* "ltr", "rtl" or "auto" */, - draggable?: bool, - hidden?: bool, - id?: string, - lang?: string, - role?: string /* ARIA role */, - style?: style, - spellCheck?: bool, - tabIndex?: int, - title?: string, - /* html5 microdata */ - itemID?: string, - itemProp?: string, - itemRef?: string, - itemScope?: bool, - itemType?: string /* uri */, - /* tag-specific html attributes */ - accept?: string, - acceptCharset?: string, - action?: string /* uri */, - allowFullScreen?: bool, - alt?: string, - @as("as") - as_?: string, - async?: bool, - autoComplete?: string /* has a fixed, but large-ish, set of possible values */, - autoCapitalize?: string /* Mobile Safari specific */, - autoFocus?: bool, - autoPlay?: bool, - challenge?: string, - charSet?: string, - checked?: bool, - cite?: string /* uri */, - crossOrigin?: string /* anonymous, use-credentials */, - cols?: int, - colSpan?: int, - content?: string, - controls?: bool, - coords?: string /* set of values specifying the coordinates of a region */, - data?: string /* uri */, - dateTime?: string /* "valid date string with optional time" */, - default?: bool, - defer?: bool, - disabled?: bool, - download?: string /* should really be either a boolean, signifying presence, or a string */, - encType?: string /* "application/x-www-form-urlencoded", "multipart/form-data" or "text/plain" */, - form?: string, - formAction?: string /* uri */, - formTarget?: string /* "_blank", "_self", etc. */, - formMethod?: string /* "post", "get", "put" */, - headers?: string, - height?: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - high?: int, - href?: string /* uri */, - hrefLang?: string, - htmlFor?: string /* substitute for "for" */, - httpEquiv?: string /* has a fixed set of possible values */, - icon?: string /* uri? */, - inputMode?: string /* "verbatim", "latin", "numeric", etc. */, - integrity?: string, - keyType?: string, - kind?: string /* has a fixed set of possible values */, - label?: string, - list?: string, - loading?: [#"lazy" | #eager], - loop?: bool, - low?: int, - manifest?: string /* uri */, - max?: string /* should be int or Js.Date.t */, - maxLength?: int, - media?: string /* a valid media query */, - mediaGroup?: string, - method?: string /* "post" or "get" */, - min?: string, - minLength?: int, - multiple?: bool, - muted?: bool, - name?: string, - nonce?: string, - noValidate?: bool, - @as("open") - open_?: bool /* use this one. Previous one is deprecated */, - optimum?: int, - pattern?: string /* valid Js RegExp */, - placeholder?: string, - playsInline?: bool, - poster?: string /* uri */, - preload?: string /* "none", "metadata" or "auto" (and "" as a synonym for "auto") */, - radioGroup?: string, - readOnly?: bool, - rel?: string /* a space- or comma-separated (depending on the element) list of a fixed set of "link types" */, - required?: bool, - reversed?: bool, - rows?: int, - rowSpan?: int, - sandbox?: string /* has a fixed set of possible values */, - scope?: string /* has a fixed set of possible values */, - scoped?: bool, - scrolling?: string /* html4 only, "auto", "yes" or "no" */, - /* seamless - supported by React, but removed from the html5 spec */ - selected?: bool, - shape?: string, - size?: int, - sizes?: string, - span?: int, - src?: string /* uri */, - srcDoc?: string, - srcLang?: string, - srcSet?: string, - start?: int, - step?: float, - summary?: string /* deprecated */, - target?: string, - @as("type") - type_?: string /* has a fixed but large-ish set of possible values */ /* use this one. Previous one is deprecated */, - useMap?: string, - value?: string, - width?: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */, - wrap?: string /* "hard" or "soft" */, - /* Clipboard events */ - onCopy?: JsxEventU.Clipboard.t => unit, - onCut?: JsxEventU.Clipboard.t => unit, - onPaste?: JsxEventU.Clipboard.t => unit, - /* Composition events */ - onCompositionEnd?: JsxEventU.Composition.t => unit, - onCompositionStart?: JsxEventU.Composition.t => unit, - onCompositionUpdate?: JsxEventU.Composition.t => unit, - /* Keyboard events */ - onKeyDown?: JsxEventU.Keyboard.t => unit, - onKeyPress?: JsxEventU.Keyboard.t => unit, - onKeyUp?: JsxEventU.Keyboard.t => unit, - /* Focus events */ - onFocus?: JsxEventU.Focus.t => unit, - onBlur?: JsxEventU.Focus.t => unit, - /* Form events */ - onBeforeInput?: JsxEventU.Form.t => unit, - onChange?: JsxEventU.Form.t => unit, - onInput?: JsxEventU.Form.t => unit, - onReset?: JsxEventU.Form.t => unit, - onSubmit?: JsxEventU.Form.t => unit, - onInvalid?: JsxEventU.Form.t => unit, - /* Mouse events */ - onClick?: JsxEventU.Mouse.t => unit, - onContextMenu?: JsxEventU.Mouse.t => unit, - onDoubleClick?: JsxEventU.Mouse.t => unit, - onDrag?: JsxEventU.Mouse.t => unit, - onDragEnd?: JsxEventU.Mouse.t => unit, - onDragEnter?: JsxEventU.Mouse.t => unit, - onDragExit?: JsxEventU.Mouse.t => unit, - onDragLeave?: JsxEventU.Mouse.t => unit, - onDragOver?: JsxEventU.Mouse.t => unit, - onDragStart?: JsxEventU.Mouse.t => unit, - onDrop?: JsxEventU.Mouse.t => unit, - onMouseDown?: JsxEventU.Mouse.t => unit, - onMouseEnter?: JsxEventU.Mouse.t => unit, - onMouseLeave?: JsxEventU.Mouse.t => unit, - onMouseMove?: JsxEventU.Mouse.t => unit, - onMouseOut?: JsxEventU.Mouse.t => unit, - onMouseOver?: JsxEventU.Mouse.t => unit, - onMouseUp?: JsxEventU.Mouse.t => unit, - /* Selection events */ - onSelect?: JsxEventU.Selection.t => unit, - /* Touch events */ - onTouchCancel?: JsxEventU.Touch.t => unit, - onTouchEnd?: JsxEventU.Touch.t => unit, - onTouchMove?: JsxEventU.Touch.t => unit, - onTouchStart?: JsxEventU.Touch.t => unit, - // Pointer events - onPointerOver?: JsxEventU.Pointer.t => unit, - onPointerEnter?: JsxEventU.Pointer.t => unit, - onPointerDown?: JsxEventU.Pointer.t => unit, - onPointerMove?: JsxEventU.Pointer.t => unit, - onPointerUp?: JsxEventU.Pointer.t => unit, - onPointerCancel?: JsxEventU.Pointer.t => unit, - onPointerOut?: JsxEventU.Pointer.t => unit, - onPointerLeave?: JsxEventU.Pointer.t => unit, - onGotPointerCapture?: JsxEventU.Pointer.t => unit, - onLostPointerCapture?: JsxEventU.Pointer.t => unit, - /* UI events */ - onScroll?: JsxEventU.UI.t => unit, - /* Wheel events */ - onWheel?: JsxEventU.Wheel.t => unit, - /* Media events */ - onAbort?: JsxEventU.Media.t => unit, - onCanPlay?: JsxEventU.Media.t => unit, - onCanPlayThrough?: JsxEventU.Media.t => unit, - onDurationChange?: JsxEventU.Media.t => unit, - onEmptied?: JsxEventU.Media.t => unit, - onEncrypted?: JsxEventU.Media.t => unit, - onEnded?: JsxEventU.Media.t => unit, - onError?: JsxEventU.Media.t => unit, - onLoadedData?: JsxEventU.Media.t => unit, - onLoadedMetadata?: JsxEventU.Media.t => unit, - onLoadStart?: JsxEventU.Media.t => unit, - onPause?: JsxEventU.Media.t => unit, - onPlay?: JsxEventU.Media.t => unit, - onPlaying?: JsxEventU.Media.t => unit, - onProgress?: JsxEventU.Media.t => unit, - onRateChange?: JsxEventU.Media.t => unit, - onSeeked?: JsxEventU.Media.t => unit, - onSeeking?: JsxEventU.Media.t => unit, - onStalled?: JsxEventU.Media.t => unit, - onSuspend?: JsxEventU.Media.t => unit, - onTimeUpdate?: JsxEventU.Media.t => unit, - onVolumeChange?: JsxEventU.Media.t => unit, - onWaiting?: JsxEventU.Media.t => unit, - /* Image events */ - onLoad?: JsxEventU.Image.t => unit /* duplicate */ /* ~onError: ReactEvent.Image.t => unit=?, */, - /* Animation events */ - onAnimationStart?: JsxEventU.Animation.t => unit, - onAnimationEnd?: JsxEventU.Animation.t => unit, - onAnimationIteration?: JsxEventU.Animation.t => unit, - /* Transition events */ - onTransitionEnd?: JsxEventU.Transition.t => unit, - /* svg */ - accentHeight?: string, - accumulate?: string, - additive?: string, - alignmentBaseline?: string, - allowReorder?: string, - alphabetic?: string, - amplitude?: string, - arabicForm?: string, - ascent?: string, - attributeName?: string, - attributeType?: string, - autoReverse?: string, - azimuth?: string, - baseFrequency?: string, - baseProfile?: string, - baselineShift?: string, - bbox?: string, - begin?: string, - @deprecated("Please use begin") - begin_?: string, - bias?: string, - by?: string, - calcMode?: string, - capHeight?: string, - clip?: string, - clipPath?: string, - clipPathUnits?: string, - clipRule?: string, - colorInterpolation?: string, - colorInterpolationFilters?: string, - colorProfile?: string, - colorRendering?: string, - contentScriptType?: string, - contentStyleType?: string, - cursor?: string, - cx?: string, - cy?: string, - d?: string, - decelerate?: string, - descent?: string, - diffuseConstant?: string, - direction?: string, - display?: string, - divisor?: string, - dominantBaseline?: string, - dur?: string, - dx?: string, - dy?: string, - edgeMode?: string, - elevation?: string, - enableBackground?: string, - end?: string, - @deprecated("Please use end") - end_?: string, - exponent?: string, - externalResourcesRequired?: string, - fill?: string, - fillOpacity?: string, - fillRule?: string, - filter?: string, - filterRes?: string, - filterUnits?: string, - floodColor?: string, - floodOpacity?: string, - focusable?: string, - fontFamily?: string, - fontSize?: string, - fontSizeAdjust?: string, - fontStretch?: string, - fontStyle?: string, - fontVariant?: string, - fontWeight?: string, - fomat?: string, - from?: string, - fx?: string, - fy?: string, - g1?: string, - g2?: string, - glyphName?: string, - glyphOrientationHorizontal?: string, - glyphOrientationVertical?: string, - glyphRef?: string, - gradientTransform?: string, - gradientUnits?: string, - hanging?: string, - horizAdvX?: string, - horizOriginX?: string, - ideographic?: string, - imageRendering?: string, - @as("in") - in_?: string /* use this one. Previous one is deprecated */, - in2?: string, - intercept?: string, - k?: string, - k1?: string, - k2?: string, - k3?: string, - k4?: string, - kernelMatrix?: string, - kernelUnitLength?: string, - kerning?: string, - keyPoints?: string, - keySplines?: string, - keyTimes?: string, - lengthAdjust?: string, - letterSpacing?: string, - lightingColor?: string, - limitingConeAngle?: string, - local?: string, - markerEnd?: string, - markerHeight?: string, - markerMid?: string, - markerStart?: string, - markerUnits?: string, - markerWidth?: string, - mask?: string, - maskContentUnits?: string, - maskUnits?: string, - mathematical?: string, - mode?: string, - numOctaves?: string, - offset?: string, - opacity?: string, - operator?: string, - order?: string, - orient?: string, - orientation?: string, - origin?: string, - overflow?: string, - overflowX?: string, - overflowY?: string, - overlinePosition?: string, - overlineThickness?: string, - paintOrder?: string, - panose1?: string, - pathLength?: string, - patternContentUnits?: string, - patternTransform?: string, - patternUnits?: string, - pointerEvents?: string, - points?: string, - pointsAtX?: string, - pointsAtY?: string, - pointsAtZ?: string, - preserveAlpha?: string, - preserveAspectRatio?: string, - primitiveUnits?: string, - r?: string, - radius?: string, - refX?: string, - refY?: string, - renderingIntent?: string, - repeatCount?: string, - repeatDur?: string, - requiredExtensions?: string, - requiredFeatures?: string, - restart?: string, - result?: string, - rotate?: string, - rx?: string, - ry?: string, - scale?: string, - seed?: string, - shapeRendering?: string, - slope?: string, - spacing?: string, - specularConstant?: string, - specularExponent?: string, - speed?: string, - spreadMethod?: string, - startOffset?: string, - stdDeviation?: string, - stemh?: string, - stemv?: string, - stitchTiles?: string, - stopColor?: string, - stopOpacity?: string, - strikethroughPosition?: string, - strikethroughThickness?: string, - string?: string, - stroke?: string, - strokeDasharray?: string, - strokeDashoffset?: string, - strokeLinecap?: string, - strokeLinejoin?: string, - strokeMiterlimit?: string, - strokeOpacity?: string, - strokeWidth?: string, - surfaceScale?: string, - systemLanguage?: string, - tableValues?: string, - targetX?: string, - targetY?: string, - textAnchor?: string, - textDecoration?: string, - textLength?: string, - textRendering?: string, - to?: string, - @deprecated("Please use to") - to_?: string, - transform?: string, - u1?: string, - u2?: string, - underlinePosition?: string, - underlineThickness?: string, - unicode?: string, - unicodeBidi?: string, - unicodeRange?: string, - unitsPerEm?: string, - vAlphabetic?: string, - vHanging?: string, - vIdeographic?: string, - vMathematical?: string, - values?: string, - vectorEffect?: string, - version?: string, - vertAdvX?: string, - vertAdvY?: string, - vertOriginX?: string, - vertOriginY?: string, - viewBox?: string, - viewTarget?: string, - visibility?: string, - /* width::string? => */ - widths?: string, - wordSpacing?: string, - writingMode?: string, - x?: string, - x1?: string, - x2?: string, - xChannelSelector?: string, - xHeight?: string, - xlinkActuate?: string, - xlinkArcrole?: string, - xlinkHref?: string, - xlinkRole?: string, - xlinkShow?: string, - xlinkTitle?: string, - xlinkType?: string, - xmlns?: string, - xmlnsXlink?: string, - xmlBase?: string, - xmlLang?: string, - xmlSpace?: string, - y?: string, - y1?: string, - y2?: string, - yChannelSelector?: string, - z?: string, - zoomAndPan?: string, - /* RDFa */ - about?: string, - datatype?: string, - inlist?: string, - prefix?: string, - property?: string, - resource?: string, - typeof?: string, - vocab?: string, - /* react-specific */ - dangerouslySetInnerHTML?: {"__html": string}, - suppressContentEditableWarning?: bool, -} diff --git a/jscomp/others/jsxEventC.res b/jscomp/others/jsxEvent.res similarity index 99% rename from jscomp/others/jsxEventC.res rename to jscomp/others/jsxEvent.res index 78c27a2bf0..d8de1b5c44 100644 --- a/jscomp/others/jsxEventC.res +++ b/jscomp/others/jsxEvent.res @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*** Internal: use JsxEvent directly. */ - type synthetic<'a> module MakeEventWithType = ( diff --git a/jscomp/others/jsxEventU.res b/jscomp/others/jsxEventU.res deleted file mode 100644 index 0d67f225c7..0000000000 --- a/jscomp/others/jsxEventU.res +++ /dev/null @@ -1,350 +0,0 @@ -/* Copyright (C) 2015-2016 Bloomberg Finance L.P. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/*** Internal: use JsxEvent directly. */ - -@@uncurried - -type synthetic<'a> - -module MakeEventWithType = ( - Type: { - type t - }, -) => { - @get external bubbles: Type.t => bool = "bubbles" - @get external cancelable: Type.t => bool = "cancelable" - @get external currentTarget: Type.t => {..} = "currentTarget" - - /* Should return Dom.eventTarget */ - @get external defaultPrevented: Type.t => bool = "defaultPrevented" - @get external eventPhase: Type.t => int = "eventPhase" - @get external isTrusted: Type.t => bool = "isTrusted" - @get external nativeEvent: Type.t => {..} = "nativeEvent" - - /* Should return Dom.event */ - @send external preventDefault: Type.t => unit = "preventDefault" - - @send external isDefaultPrevented: Type.t => bool = "isDefaultPrevented" - - @send external stopPropagation: Type.t => unit = "stopPropagation" - - @send external isPropagationStopped: Type.t => bool = "isPropagationStopped" - - @get external target: Type.t => {..} = "target" - - /* Should return Dom.eventTarget */ - @get external timeStamp: Type.t => float = "timeStamp" - @get external type_: Type.t => string = "type" - @send external persist: Type.t => unit = "persist" -} - -module Synthetic = { - type tag - type t = synthetic - - @get external bubbles: synthetic<'a> => bool = "bubbles" - @get external cancelable: synthetic<'a> => bool = "cancelable" - @get external currentTarget: synthetic<'a> => {..} = "currentTarget" - /* Should return Dom.eventTarget */ - - @get external defaultPrevented: synthetic<'a> => bool = "defaultPrevented" - - @get external eventPhase: synthetic<'a> => int = "eventPhase" - @get external isTrusted: synthetic<'a> => bool = "isTrusted" - @get external nativeEvent: synthetic<'a> => {..} = "nativeEvent" - - /* Should return Dom.event */ - @send external preventDefault: synthetic<'a> => unit = "preventDefault" - - @send external isDefaultPrevented: synthetic<'a> => bool = "isDefaultPrevented" - - @send external stopPropagation: synthetic<'a> => unit = "stopPropagation" - - @send external isPropagationStopped: synthetic<'a> => bool = "isPropagationStopped" - - @get external target: synthetic<'a> => {..} = "target" - - /* Should return Dom.eventTarget */ - @get external timeStamp: synthetic<'a> => float = "timeStamp" - @get external type_: synthetic<'a> => string = "type" - @send external persist: synthetic<'a> => unit = "persist" -} - -/* Cast any event type to the general synthetic type. This is safe, since synthetic is more general */ -external toSyntheticEvent: synthetic<'a> => Synthetic.t = "%identity" - -module Clipboard = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external clipboardData: t => {..} = "clipboardData" - /* Should return Dom.dataTransfer */ -} - -module Composition = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external data: t => string = "data" -} - -module Keyboard = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external altKey: t => bool = "altKey" - @get external charCode: t => int = "charCode" - @get external ctrlKey: t => bool = "ctrlKey" - - @send external getModifierState: (t, string) => bool = "getModifierState" - - @get external key: t => string = "key" - @get external keyCode: t => int = "keyCode" - @get external locale: t => string = "locale" - @get external location: t => int = "location" - @get external metaKey: t => bool = "metaKey" - @get external repeat: t => bool = "repeat" - @get external shiftKey: t => bool = "shiftKey" - @get external which: t => int = "which" -} - -module Focus = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get @return(nullable) external relatedTarget: t => option<{..}> = "relatedTarget" - /* Should return Dom.eventTarget */ -} - -module Form = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) -} - -module Mouse = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external altKey: t => bool = "altKey" - @get external button: t => int = "button" - @get external buttons: t => int = "buttons" - @get external clientX: t => int = "clientX" - @get external clientY: t => int = "clientY" - @get external ctrlKey: t => bool = "ctrlKey" - - @get external getModifierState: (t => string) => bool = "getModifierState" - - @get external metaKey: t => bool = "metaKey" - @get external movementX: t => int = "movementX" - @get external movementY: t => int = "movementY" - @get external pageX: t => int = "pageX" - @get external pageY: t => int = "pageY" - - @get @return(nullable) external relatedTarget: t => option<{..}> = "relatedTarget" - - /* Should return Dom.eventTarget */ - @get external screenX: t => int = "screenX" - @get external screenY: t => int = "screenY" - @get external shiftKey: t => bool = "shiftKey" -} - -module Pointer = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - /* UIEvent */ - @get @get - external detail: t => int = "detail" - - /* external view : t -> Dom.window = "view" */ - /* Should return DOMAbstractView/WindowProxy */ - - /* MouseEvent */ - @get external screenX: t => int = "screenX" - @get external screenY: t => int = "screenY" - @get external clientX: t => int = "clientX" - @get external clientY: t => int = "clientY" - @get external pageX: t => int = "pageX" - @get external pageY: t => int = "pageY" - @get external movementX: t => int = "movementX" - @get external movementY: t => int = "movementY" - @get external ctrlKey: t => bool = "ctrlKey" - @get external shiftKey: t => bool = "shiftKey" - @get external altKey: t => bool = "altKey" - @get external metaKey: t => bool = "metaKey" - - @get external getModifierState: (t => string) => bool = "getModifierState" - - @get external button: t => int = "button" - @get external buttons: t => int = "buttons" - - @get @return(nullable) external relatedTarget: t => option<{..}> = "relatedTarget" - /* Should return Dom.eventTarget */ - - /* PointerEvent */ - /* external pointerId : t -> Dom.eventPointerId = "pointerId" [@@get] */ - @get external width: t => float = "width" - @get external height: t => float = "height" - @get external pressure: t => float = "pressure" - @get external tangentialPressure: t => float = "tangentialPressure" - @get external tiltX: t => int = "tiltX" - @get external tiltY: t => int = "tiltY" - @get external twist: t => int = "twist" - @get external pointerType: t => string = "pointerType" - @get external isPrimary: t => bool = "isPrimary" -} - -module Selection = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) -} - -module Touch = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external altKey: t => bool = "altKey" - @get external changedTouches: t => {..} = "changedTouches" - /* Should return Dom.touchList */ - - @get external ctrlKey: t => bool = "ctrlKey" - - @send external getModifierState: (t => string) => bool = "getModifierState" - - @get external metaKey: t => bool = "metaKey" - @get external shiftKey: t => bool = "shiftKey" - @get external targetTouches: t => {..} = "targetTouches" - /* Should return Dom.touchList */ - - @get external touches: t => {..} = "touches" - /* Should return Dom.touchList */ -} - -module UI = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external detail: t => int = "detail" - /* external view : t -> Dom.window = "view" [@@get] */ - /* Should return DOMAbstractView/WindowProxy */ -} - -module Wheel = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external deltaMode: t => int = "deltaMode" - @get external deltaX: t => float = "deltaX" - @get external deltaY: t => float = "deltaY" - @get external deltaZ: t => float = "deltaZ" -} - -module Media = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) -} - -module Image = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) -} - -module Animation = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external animationName: t => string = "animationName" - @get external pseudoElement: t => string = "pseudoElement" - @get external elapsedTime: t => float = "elapsedTime" -} - -module Transition = { - type tag - type t = synthetic - - include MakeEventWithType({ - type t = t - }) - - @get external propertyName: t => string = "propertyName" - @get external pseudoElement: t => string = "pseudoElement" - @get external elapsedTime: t => float = "elapsedTime" -} diff --git a/jscomp/others/jsxPPXReactSupportC.res b/jscomp/others/jsxPPXReactSupport.res similarity index 99% rename from jscomp/others/jsxPPXReactSupportC.res rename to jscomp/others/jsxPPXReactSupport.res index a024d44718..824203df57 100644 --- a/jscomp/others/jsxPPXReactSupportC.res +++ b/jscomp/others/jsxPPXReactSupport.res @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -module Jsx = JsxC - %%private( @val external propsWithKey: ({"key": string}, 'props) => 'props = "Object.assign" diff --git a/jscomp/others/jsxPPXReactSupportU.res b/jscomp/others/jsxPPXReactSupportU.res deleted file mode 100644 index a850efc120..0000000000 --- a/jscomp/others/jsxPPXReactSupportU.res +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2022- Authors of ReScript - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -module Jsx = JsxU - -%%private( - @val - external propsWithKey: ({"key": string}, 'props) => 'props = "Object.assign" - - @inline - let addKeyProp = (~key: option=?, p: 'props): 'props => - switch key { - | Some(key) => propsWithKey({"key": key}, p) - | None => p - } -) - -@@uncurried // Can't move this up as @inline not working with uncurried - -@module("react") -external createElement: (Jsx.component<'props>, 'props) => Jsx.element = "createElement" - -@variadic @module("react") -external createElementVariadic: (Jsx.component<'props>, 'props, array) => Jsx.element = - "createElement" - -let createElementWithKey = (~key=?, component, props) => - createElement(component, addKeyProp(~key?, props)) - -let createElementVariadicWithKey = (~key=?, component, props, elements) => - createElementVariadic(component, addKeyProp(~key?, props), elements) - -external asyncComponent: promise => Jsx.element = "%identity" diff --git a/jscomp/others/jsxU.res b/jscomp/others/jsxU.res deleted file mode 100644 index 70f3c67430..0000000000 --- a/jscomp/others/jsxU.res +++ /dev/null @@ -1,20 +0,0 @@ -/*** Internal: use Jsx directly. */ - -@@uncurried - -type element -type ref - -@val external null: element = "null" - -external float: float => element = "%identity" -external int: int => element = "%identity" -external string: string => element = "%identity" - -external array: array => element = "%identity" - -type componentLike<'props, 'return> = 'props => 'return -type component<'props> = componentLike<'props, element> - -/* this function exists to prepare for making `component` abstract */ -external component: componentLike<'props, element> => component<'props> = "%identity" diff --git a/jscomp/others/release.ninja b/jscomp/others/release.ninja index 3d50070551..7f1b0e83cc 100644 --- a/jscomp/others/release.ninja +++ b/jscomp/others/release.ninja @@ -63,16 +63,12 @@ o others/js_vector.cmj : cc_cmi others/js_vector.res | others/belt_internals.cmi o others/js_vector.cmi : cc others/js_vector.resi | others/belt_internals.cmi others/js.cmi $bsc o others/js_weakmap.cmi others/js_weakmap.cmj : cc others/js_weakmap.res | others/belt_internals.cmi others/js.cmi $bsc o others/js_weakset.cmi others/js_weakset.cmj : cc others/js_weakset.res | others/belt_internals.cmi others/js.cmi $bsc -o others/jsxC.cmi others/jsxC.cmj : cc others/jsxC.res | others/belt_internals.cmi others/js.cmi $bsc -o others/jsxDOMC.cmi others/jsxDOMC.cmj : cc others/jsxDOMC.res | others/belt_internals.cmi others/js.cmi others/jsxC.cmj others/jsxDOMStyle.cmj others/jsxEventC.cmj $bsc +o others/jsx.cmi others/jsx.cmj : cc others/jsx.res | others/belt_internals.cmi others/js.cmi $bsc +o others/jsxDOM.cmi others/jsxDOM.cmj : cc others/jsxDOM.res | others/belt_internals.cmi others/js.cmi others/jsx.cmj others/jsxDOMStyle.cmj others/jsxEvent.cmj $bsc o others/jsxDOMStyle.cmi others/jsxDOMStyle.cmj : cc others/jsxDOMStyle.res | others/belt_internals.cmi others/js.cmi $bsc -o others/jsxDOMU.cmi others/jsxDOMU.cmj : cc others/jsxDOMU.res | others/belt_internals.cmi others/js.cmi others/jsxDOMStyle.cmj others/jsxEventU.cmj others/jsxU.cmj $bsc -o others/jsxEventC.cmi others/jsxEventC.cmj : cc others/jsxEventC.res | others/belt_internals.cmi others/js.cmi $bsc -o others/jsxEventU.cmi others/jsxEventU.cmj : cc others/jsxEventU.res | others/belt_internals.cmi others/js.cmi $bsc -o others/jsxPPXReactSupportC.cmi others/jsxPPXReactSupportC.cmj : cc others/jsxPPXReactSupportC.res | others/belt_internals.cmi others/js.cmi others/jsxC.cmj $bsc -o others/jsxPPXReactSupportU.cmi others/jsxPPXReactSupportU.cmj : cc others/jsxPPXReactSupportU.res | others/belt_internals.cmi others/js.cmi others/jsxU.cmj $bsc -o others/jsxU.cmi others/jsxU.cmj : cc others/jsxU.res | others/belt_internals.cmi others/js.cmi $bsc -o js_pkg : phony others/js_OO.cmi others/js_OO.cmj others/js_array.cmi others/js_array.cmj others/js_array2.cmi others/js_array2.cmj others/js_bigint.cmi others/js_bigint.cmj others/js_blob.cmi others/js_blob.cmj others/js_cast.cmi others/js_cast.cmj others/js_console.cmi others/js_console.cmj others/js_date.cmi others/js_date.cmj others/js_dict.cmi others/js_dict.cmj others/js_exn.cmi others/js_exn.cmj others/js_file.cmi others/js_file.cmj others/js_float.cmi others/js_float.cmj others/js_global.cmi others/js_global.cmj others/js_int.cmi others/js_int.cmj others/js_json.cmi others/js_json.cmj others/js_list.cmi others/js_list.cmj others/js_map.cmi others/js_map.cmj others/js_math.cmi others/js_math.cmj others/js_null.cmi others/js_null.cmj others/js_null_undefined.cmi others/js_null_undefined.cmj others/js_obj.cmi others/js_obj.cmj others/js_option.cmi others/js_option.cmj others/js_promise.cmi others/js_promise.cmj others/js_promise2.cmi others/js_promise2.cmj others/js_re.cmi others/js_re.cmj others/js_result.cmi others/js_result.cmj others/js_set.cmi others/js_set.cmj others/js_string.cmi others/js_string.cmj others/js_string2.cmi others/js_string2.cmj others/js_typed_array.cmi others/js_typed_array.cmj others/js_typed_array2.cmi others/js_typed_array2.cmj others/js_types.cmi others/js_types.cmj others/js_undefined.cmi others/js_undefined.cmj others/js_vector.cmi others/js_vector.cmj others/js_weakmap.cmi others/js_weakmap.cmj others/js_weakset.cmi others/js_weakset.cmj others/jsxC.cmi others/jsxC.cmj others/jsxDOMC.cmi others/jsxDOMC.cmj others/jsxDOMStyle.cmi others/jsxDOMStyle.cmj others/jsxDOMU.cmi others/jsxDOMU.cmj others/jsxEventC.cmi others/jsxEventC.cmj others/jsxEventU.cmi others/jsxEventU.cmj others/jsxPPXReactSupportC.cmi others/jsxPPXReactSupportC.cmj others/jsxPPXReactSupportU.cmi others/jsxPPXReactSupportU.cmj others/jsxU.cmi others/jsxU.cmj +o others/jsxEvent.cmi others/jsxEvent.cmj : cc others/jsxEvent.res | others/belt_internals.cmi others/js.cmi $bsc +o others/jsxPPXReactSupport.cmi others/jsxPPXReactSupport.cmj : cc others/jsxPPXReactSupport.res | others/belt_internals.cmi others/js.cmi others/jsx.cmj $bsc +o js_pkg : phony others/js_OO.cmi others/js_OO.cmj others/js_array.cmi others/js_array.cmj others/js_array2.cmi others/js_array2.cmj others/js_bigint.cmi others/js_bigint.cmj others/js_blob.cmi others/js_blob.cmj others/js_cast.cmi others/js_cast.cmj others/js_console.cmi others/js_console.cmj others/js_date.cmi others/js_date.cmj others/js_dict.cmi others/js_dict.cmj others/js_exn.cmi others/js_exn.cmj others/js_file.cmi others/js_file.cmj others/js_float.cmi others/js_float.cmj others/js_global.cmi others/js_global.cmj others/js_int.cmi others/js_int.cmj others/js_json.cmi others/js_json.cmj others/js_list.cmi others/js_list.cmj others/js_map.cmi others/js_map.cmj others/js_math.cmi others/js_math.cmj others/js_null.cmi others/js_null.cmj others/js_null_undefined.cmi others/js_null_undefined.cmj others/js_obj.cmi others/js_obj.cmj others/js_option.cmi others/js_option.cmj others/js_promise.cmi others/js_promise.cmj others/js_promise2.cmi others/js_promise2.cmj others/js_re.cmi others/js_re.cmj others/js_result.cmi others/js_result.cmj others/js_set.cmi others/js_set.cmj others/js_string.cmi others/js_string.cmj others/js_string2.cmi others/js_string2.cmj others/js_typed_array.cmi others/js_typed_array.cmj others/js_typed_array2.cmi others/js_typed_array2.cmj others/js_types.cmi others/js_types.cmj others/js_undefined.cmi others/js_undefined.cmj others/js_vector.cmi others/js_vector.cmj others/js_weakmap.cmi others/js_weakmap.cmj others/js_weakset.cmi others/js_weakset.cmj others/jsx.cmi others/jsx.cmj others/jsxDOM.cmi others/jsxDOM.cmj others/jsxDOMStyle.cmi others/jsxDOMStyle.cmj others/jsxEvent.cmi others/jsxEvent.cmj others/jsxPPXReactSupport.cmi others/jsxPPXReactSupport.cmj o others/belt_Array.cmj : cc_cmi others/belt_Array.res | others/belt.cmi others/belt_Array.cmi others/belt_internals.cmi others/js.cmi $bsc js_pkg o others/belt_Array.cmi : cc others/belt_Array.resi | others/belt_internals.cmi others/js.cmi $bsc o others/belt_Float.cmj : cc_cmi others/belt_Float.res | others/belt.cmi others/belt_Float.cmi others/belt_internals.cmi others/js.cmi $bsc js_pkg diff --git a/jscomp/stdlib-406/pervasives.res b/jscomp/stdlib-406/pervasives.res index 632d0b7228..0cb4454052 100644 --- a/jscomp/stdlib-406/pervasives.res +++ b/jscomp/stdlib-406/pervasives.res @@ -13,17 +13,6 @@ /* */ /* ************************************************************************ */ -module Jsx = JsxC -module JsxEvent = JsxEventC -module JsxDOM = JsxDOMC -module JsxPPXReactSupport = JsxPPXReactSupportC - -module JsxModules = { - module Jsx = JsxC - module JsxEvent = JsxEventC - module JsxDOM = JsxDOMC -} - /* Internal */ external __unsafe_cast: 'a => 'b = "%identity" diff --git a/jscomp/stdlib-406/pervasives.resi b/jscomp/stdlib-406/pervasives.resi index 43407ced92..ecc6f5e13d 100644 --- a/jscomp/stdlib-406/pervasives.resi +++ b/jscomp/stdlib-406/pervasives.resi @@ -24,19 +24,6 @@ name, without prefixing them by [Pervasives]. */ -module Jsx = JsxC -module JsxEvent = JsxEventC -module JsxDOM = JsxDOMC -module JsxPPXReactSupport = JsxPPXReactSupportC - -/* For autocomplete */ -module JsxModules: { - module Jsx = JsxC - module JsxEvent = JsxEventC - module JsxDOM = JsxDOMC - // skip JsxPPXReactSupport as it's not user-facing -} - /* Internal */ external __unsafe_cast: 'a => 'b = "%identity" /* 1 Exceptions} */ diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index bb5c1c7235..4db87f87cc 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -3307,130 +3307,6 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let comment = function () { - while(true) { - if (accept(/* ')' */41)) { - return epsilon; - } - i.contents = i.contents + 1 | 0; - _param = undefined; - continue; - }; - }; - let bracket = function (_s) { - while(true) { - let s = _s; - if (s !== /* [] */0 && accept(/* ']' */93)) { - return s; - } - let match = char(); - if (match.NAME === "Char") { - let c = match.VAL; - if (accept(/* '-' */45)) { - if (accept(/* ']' */93)) { - return { - hd: { - TAG: "Set", - _0: single(c) - }, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '-' */45, - /* '-' */45 - ], - tl: /* [] */0 - } - }, - tl: s - } - }; - } - let match$1 = char(); - if (match$1.NAME !== "Char") { - return { - hd: { - TAG: "Set", - _0: single(c) - }, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '-' */45, - /* '-' */45 - ], - tl: /* [] */0 - } - }, - tl: { - hd: match$1.VAL, - tl: s - } - } - }; - } - _s = { - hd: rg(c, match$1.VAL), - tl: s - }; - continue; - } - _s = { - hd: { - TAG: "Set", - _0: single(c) - }, - tl: s - }; - continue; - } - _s = { - hd: match.VAL, - tl: s - }; - continue; - }; - }; - let piece = function () { - let r = atom(); - if (accept(/* '*' */42)) { - return greedy_mod(rep$1(r)); - } - if (accept(/* '+' */43)) { - return greedy_mod(rep1(r)); - } - if (accept(/* '?' */63)) { - return greedy_mod(opt(r)); - } - if (!accept(/* '{' */123)) { - return r; - } - let i$1 = integer(); - if (i$1 !== undefined) { - let j = accept(/* ',' */44) ? integer() : i$1; - if (!accept(/* '}' */125)) { - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); - } - if (j !== undefined && j < i$1) { - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); - } - return greedy_mod(repn(r, i$1, j)); - } - i.contents = i.contents - 1 | 0; - return r; - }; let branch$p = function (_left) { while(true) { let left = _left; @@ -3444,39 +3320,6 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let integer = function () { - if (i.contents === l) { - return; - } - let d = get(); - if (d > 57 || d < 48) { - i.contents = i.contents - 1 | 0; - return; - } else { - let _i = d - /* '0' */48 | 0; - while(true) { - let i$1 = _i; - if (i.contents === l) { - return i$1; - } - let d$1 = get(); - if (d$1 > 57 || d$1 < 48) { - i.contents = i.contents - 1 | 0; - return i$1; - } - let i$p = Math.imul(10, i$1) + (d$1 - /* '0' */48 | 0) | 0; - if (i$p < i$1) { - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); - } - _i = i$p; - continue; - }; - } - }; let atom = function () { if (accept(/* '.' */46)) { if (dotall) { @@ -3740,6 +3583,75 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; + let integer = function () { + if (i.contents === l) { + return; + } + let d = get(); + if (d > 57 || d < 48) { + i.contents = i.contents - 1 | 0; + return; + } else { + let _i = d - /* '0' */48 | 0; + while(true) { + let i$1 = _i; + if (i.contents === l) { + return i$1; + } + let d$1 = get(); + if (d$1 > 57 || d$1 < 48) { + i.contents = i.contents - 1 | 0; + return i$1; + } + let i$p = Math.imul(10, i$1) + (d$1 - /* '0' */48 | 0) | 0; + if (i$p < i$1) { + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); + } + _i = i$p; + continue; + }; + } + }; + let piece = function () { + let r = atom(); + if (accept(/* '*' */42)) { + return greedy_mod(rep$1(r)); + } + if (accept(/* '+' */43)) { + return greedy_mod(rep1(r)); + } + if (accept(/* '?' */63)) { + return greedy_mod(opt(r)); + } + if (!accept(/* '{' */123)) { + return r; + } + let i$1 = integer(); + if (i$1 !== undefined) { + let j = accept(/* ',' */44) ? integer() : i$1; + if (!accept(/* '}' */125)) { + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); + } + if (j !== undefined && j < i$1) { + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); + } + return greedy_mod(repn(r, i$1, j)); + } + i.contents = i.contents - 1 | 0; + return r; + }; let char = function () { if (i.contents === l) { throw new Error(Parse_error, { @@ -4046,6 +3958,94 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; + let bracket = function (_s) { + while(true) { + let s = _s; + if (s !== /* [] */0 && accept(/* ']' */93)) { + return s; + } + let match = char(); + if (match.NAME === "Char") { + let c = match.VAL; + if (accept(/* '-' */45)) { + if (accept(/* ']' */93)) { + return { + hd: { + TAG: "Set", + _0: single(c) + }, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '-' */45, + /* '-' */45 + ], + tl: /* [] */0 + } + }, + tl: s + } + }; + } + let match$1 = char(); + if (match$1.NAME !== "Char") { + return { + hd: { + TAG: "Set", + _0: single(c) + }, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '-' */45, + /* '-' */45 + ], + tl: /* [] */0 + } + }, + tl: { + hd: match$1.VAL, + tl: s + } + } + }; + } + _s = { + hd: rg(c, match$1.VAL), + tl: s + }; + continue; + } + _s = { + hd: { + TAG: "Set", + _0: single(c) + }, + tl: s + }; + continue; + } + _s = { + hd: match.VAL, + tl: s + }; + continue; + }; + }; + let comment = function () { + while(true) { + if (accept(/* ')' */41)) { + return epsilon; + } + i.contents = i.contents + 1 | 0; + _param = undefined; + continue; + }; + }; let res = regexp(); if (i.contents !== l) { throw new Error(Parse_error, { diff --git a/jscomp/test/test_pervasive.js b/jscomp/test/test_pervasive.js index 7541602d0f..b2c2d895ee 100644 --- a/jscomp/test/test_pervasive.js +++ b/jscomp/test/test_pervasive.js @@ -57,11 +57,6 @@ let Pervasives$1 = { fast_sort: List.fast_sort, sort_uniq: List.sort_uniq, merge: List.merge, - Jsx: Pervasives.Jsx, - JsxEvent: Pervasives.JsxEvent, - JsxDOM: Pervasives.JsxDOM, - JsxPPXReactSupport: Pervasives.JsxPPXReactSupport, - JsxModules: Pervasives.JsxModules, invalid_arg: Pervasives.invalid_arg, failwith: Pervasives.failwith, Exit: Pervasives.Exit, diff --git a/jscomp/test/test_pervasives2.js b/jscomp/test/test_pervasives2.js index 9af5ab9361..e4f3b31e88 100644 --- a/jscomp/test/test_pervasives2.js +++ b/jscomp/test/test_pervasives2.js @@ -58,11 +58,6 @@ let List$1 = { fast_sort: List.fast_sort, sort_uniq: List.sort_uniq, merge: List.merge, - Jsx: Pervasives.Jsx, - JsxEvent: Pervasives.JsxEvent, - JsxDOM: Pervasives.JsxDOM, - JsxPPXReactSupport: Pervasives.JsxPPXReactSupport, - JsxModules: Pervasives.JsxModules, invalid_arg: Pervasives.invalid_arg, failwith: Pervasives.failwith, Exit: Pervasives.Exit, @@ -106,11 +101,6 @@ let U = { length: Stack.length, iter: Stack.iter, fold: Stack.fold, - Jsx: Pervasives.Jsx, - JsxEvent: Pervasives.JsxEvent, - JsxDOM: Pervasives.JsxDOM, - JsxPPXReactSupport: Pervasives.JsxPPXReactSupport, - JsxModules: Pervasives.JsxModules, invalid_arg: Pervasives.invalid_arg, failwith: Pervasives.failwith, Exit: Pervasives.Exit, diff --git a/jscomp/test/test_pervasives3.js b/jscomp/test/test_pervasives3.js index 54254d6967..2ac75a92c1 100644 --- a/jscomp/test/test_pervasives3.js +++ b/jscomp/test/test_pervasives3.js @@ -5,11 +5,6 @@ let List = require("../../lib/js/list.js"); let Pervasives = require("../../lib/js/pervasives.js"); let Pervasives$1 = { - Jsx: Pervasives.Jsx, - JsxEvent: Pervasives.JsxEvent, - JsxDOM: Pervasives.JsxDOM, - JsxPPXReactSupport: Pervasives.JsxPPXReactSupport, - JsxModules: Pervasives.JsxModules, invalid_arg: Pervasives.invalid_arg, failwith: Pervasives.failwith, Exit: Pervasives.Exit, diff --git a/lib/es6/jsxC.js b/lib/es6/jsx.js similarity index 100% rename from lib/es6/jsxC.js rename to lib/es6/jsx.js diff --git a/lib/es6/jsxDOMC.js b/lib/es6/jsxDOM.js similarity index 100% rename from lib/es6/jsxDOMC.js rename to lib/es6/jsxDOM.js diff --git a/lib/es6/jsxEventC.js b/lib/es6/jsxEvent.js similarity index 100% rename from lib/es6/jsxEventC.js rename to lib/es6/jsxEvent.js diff --git a/lib/es6/jsxEventU.js b/lib/es6/jsxEventU.js deleted file mode 100644 index 268c4a40e9..0000000000 --- a/lib/es6/jsxEventU.js +++ /dev/null @@ -1,59 +0,0 @@ - - - -function MakeEventWithType(Type) { - return {}; -} - -let Synthetic = {}; - -let Clipboard = {}; - -let Composition = {}; - -let Keyboard = {}; - -let Focus = {}; - -let Form = {}; - -let Mouse = {}; - -let Pointer = {}; - -let Selection = {}; - -let Touch = {}; - -let UI = {}; - -let Wheel = {}; - -let Media = {}; - -let Image = {}; - -let Animation = {}; - -let Transition = {}; - -export { - MakeEventWithType, - Synthetic, - Clipboard, - Composition, - Keyboard, - Focus, - Form, - Mouse, - Pointer, - Selection, - Touch, - UI, - Wheel, - Media, - Image, - Animation, - Transition, -} -/* No side effect */ diff --git a/lib/es6/jsxPPXReactSupportC.js b/lib/es6/jsxPPXReactSupport.js similarity index 97% rename from lib/es6/jsxPPXReactSupportC.js rename to lib/es6/jsxPPXReactSupport.js index 85203df4e9..c6995106b8 100644 --- a/lib/es6/jsxPPXReactSupportC.js +++ b/lib/es6/jsxPPXReactSupport.js @@ -19,10 +19,7 @@ function createElementVariadicWithKey(key, component, props, elements) { ]); } -let Jsx; - export { - Jsx, createElementWithKey, createElementVariadicWithKey, } diff --git a/lib/es6/jsxPPXReactSupportU.js b/lib/es6/jsxPPXReactSupportU.js deleted file mode 100644 index 85203df4e9..0000000000 --- a/lib/es6/jsxPPXReactSupportU.js +++ /dev/null @@ -1,29 +0,0 @@ - - -import * as React from "react"; -import * as Caml_splice_call from "./caml_splice_call.js"; - -function createElementWithKey(key, component, props) { - return React.createElement(component, key !== undefined ? Object.assign({ - key: key - }, props) : props); -} - -function createElementVariadicWithKey(key, component, props, elements) { - return Caml_splice_call.spliceApply(React.createElement, [ - component, - key !== undefined ? Object.assign({ - key: key - }, props) : props, - elements - ]); -} - -let Jsx; - -export { - Jsx, - createElementWithKey, - createElementVariadicWithKey, -} -/* react Not a pure module */ diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index 24be030c16..e211c20bee 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -6,12 +6,6 @@ import * as Caml_string from "./caml_string.js"; import * as Caml_exceptions from "./caml_exceptions.js"; import * as Caml_js_exceptions from "./caml_js_exceptions.js"; -let JsxModules = { - Jsx: undefined, - JsxEvent: undefined, - JsxDOM: undefined -}; - function failwith(s) { throw new Error("Failure", { cause: { @@ -217,14 +211,6 @@ function exit(retcode) { return Caml_sys.sys_exit(retcode); } -let Jsx; - -let JsxEvent; - -let JsxDOM; - -let JsxPPXReactSupport; - let max_int = 2147483647; let infinity = Infinity; @@ -238,11 +224,6 @@ let min_float = 2.22507385850720138e-308; let epsilon_float = 2.22044604925031308e-16; export { - Jsx, - JsxEvent, - JsxDOM, - JsxPPXReactSupport, - JsxModules, invalid_arg, failwith, Exit, diff --git a/lib/es6/jsxDOMU.js b/lib/js/jsx.js similarity index 100% rename from lib/es6/jsxDOMU.js rename to lib/js/jsx.js diff --git a/lib/js/jsxC.js b/lib/js/jsxC.js deleted file mode 100644 index ae1b9f17e6..0000000000 --- a/lib/js/jsxC.js +++ /dev/null @@ -1 +0,0 @@ -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/es6/jsxU.js b/lib/js/jsxDOM.js similarity index 100% rename from lib/es6/jsxU.js rename to lib/js/jsxDOM.js diff --git a/lib/js/jsxDOMC.js b/lib/js/jsxDOMC.js deleted file mode 100644 index ae1b9f17e6..0000000000 --- a/lib/js/jsxDOMC.js +++ /dev/null @@ -1 +0,0 @@ -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/jsxDOMU.js b/lib/js/jsxDOMU.js deleted file mode 100644 index ae1b9f17e6..0000000000 --- a/lib/js/jsxDOMU.js +++ /dev/null @@ -1 +0,0 @@ -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/jsxEventC.js b/lib/js/jsxEvent.js similarity index 100% rename from lib/js/jsxEventC.js rename to lib/js/jsxEvent.js diff --git a/lib/js/jsxEventU.js b/lib/js/jsxEventU.js deleted file mode 100644 index 882412b208..0000000000 --- a/lib/js/jsxEventU.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - - -function MakeEventWithType(Type) { - return {}; -} - -let Synthetic = {}; - -let Clipboard = {}; - -let Composition = {}; - -let Keyboard = {}; - -let Focus = {}; - -let Form = {}; - -let Mouse = {}; - -let Pointer = {}; - -let Selection = {}; - -let Touch = {}; - -let UI = {}; - -let Wheel = {}; - -let Media = {}; - -let Image = {}; - -let Animation = {}; - -let Transition = {}; - -exports.MakeEventWithType = MakeEventWithType; -exports.Synthetic = Synthetic; -exports.Clipboard = Clipboard; -exports.Composition = Composition; -exports.Keyboard = Keyboard; -exports.Focus = Focus; -exports.Form = Form; -exports.Mouse = Mouse; -exports.Pointer = Pointer; -exports.Selection = Selection; -exports.Touch = Touch; -exports.UI = UI; -exports.Wheel = Wheel; -exports.Media = Media; -exports.Image = Image; -exports.Animation = Animation; -exports.Transition = Transition; -/* No side effect */ diff --git a/lib/js/jsxPPXReactSupportU.js b/lib/js/jsxPPXReactSupport.js similarity index 95% rename from lib/js/jsxPPXReactSupportU.js rename to lib/js/jsxPPXReactSupport.js index ec0aec1033..dcf807669c 100644 --- a/lib/js/jsxPPXReactSupportU.js +++ b/lib/js/jsxPPXReactSupport.js @@ -19,9 +19,6 @@ function createElementVariadicWithKey(key, component, props, elements) { ]); } -let Jsx; - -exports.Jsx = Jsx; exports.createElementWithKey = createElementWithKey; exports.createElementVariadicWithKey = createElementVariadicWithKey; /* react Not a pure module */ diff --git a/lib/js/jsxPPXReactSupportC.js b/lib/js/jsxPPXReactSupportC.js deleted file mode 100644 index ec0aec1033..0000000000 --- a/lib/js/jsxPPXReactSupportC.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -let React = require("react"); -let Caml_splice_call = require("./caml_splice_call.js"); - -function createElementWithKey(key, component, props) { - return React.createElement(component, key !== undefined ? Object.assign({ - key: key - }, props) : props); -} - -function createElementVariadicWithKey(key, component, props, elements) { - return Caml_splice_call.spliceApply(React.createElement, [ - component, - key !== undefined ? Object.assign({ - key: key - }, props) : props, - elements - ]); -} - -let Jsx; - -exports.Jsx = Jsx; -exports.createElementWithKey = createElementWithKey; -exports.createElementVariadicWithKey = createElementVariadicWithKey; -/* react Not a pure module */ diff --git a/lib/js/jsxU.js b/lib/js/jsxU.js deleted file mode 100644 index ae1b9f17e6..0000000000 --- a/lib/js/jsxU.js +++ /dev/null @@ -1 +0,0 @@ -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index 66a21474ce..851b6b0782 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -6,12 +6,6 @@ let Caml_string = require("./caml_string.js"); let Caml_exceptions = require("./caml_exceptions.js"); let Caml_js_exceptions = require("./caml_js_exceptions.js"); -let JsxModules = { - Jsx: undefined, - JsxEvent: undefined, - JsxDOM: undefined -}; - function failwith(s) { throw new Error("Failure", { cause: { @@ -217,14 +211,6 @@ function exit(retcode) { return Caml_sys.sys_exit(retcode); } -let Jsx; - -let JsxEvent; - -let JsxDOM; - -let JsxPPXReactSupport; - let max_int = 2147483647; let infinity = Infinity; @@ -237,11 +223,6 @@ let min_float = 2.22507385850720138e-308; let epsilon_float = 2.22044604925031308e-16; -exports.Jsx = Jsx; -exports.JsxEvent = JsxEvent; -exports.JsxDOM = JsxDOM; -exports.JsxPPXReactSupport = JsxPPXReactSupport; -exports.JsxModules = JsxModules; exports.invalid_arg = invalid_arg; exports.failwith = failwith; exports.Exit = Exit; diff --git a/packages/artifacts.txt b/packages/artifacts.txt index aba52a0174..cebb60acbe 100644 --- a/packages/artifacts.txt +++ b/packages/artifacts.txt @@ -155,15 +155,11 @@ lib/es6/js_undefined.js lib/es6/js_vector.js lib/es6/js_weakmap.js lib/es6/js_weakset.js -lib/es6/jsxC.js -lib/es6/jsxDOMC.js +lib/es6/jsx.js +lib/es6/jsxDOM.js lib/es6/jsxDOMStyle.js -lib/es6/jsxDOMU.js -lib/es6/jsxEventC.js -lib/es6/jsxEventU.js -lib/es6/jsxPPXReactSupportC.js -lib/es6/jsxPPXReactSupportU.js -lib/es6/jsxU.js +lib/es6/jsxEvent.js +lib/es6/jsxPPXReactSupport.js lib/es6/lazy.js lib/es6/lexing.js lib/es6/list.js @@ -321,15 +317,11 @@ lib/js/js_undefined.js lib/js/js_vector.js lib/js/js_weakmap.js lib/js/js_weakset.js -lib/js/jsxC.js -lib/js/jsxDOMC.js +lib/js/jsx.js +lib/js/jsxDOM.js lib/js/jsxDOMStyle.js -lib/js/jsxDOMU.js -lib/js/jsxEventC.js -lib/js/jsxEventU.js -lib/js/jsxPPXReactSupportC.js -lib/js/jsxPPXReactSupportU.js -lib/js/jsxU.js +lib/js/jsxEvent.js +lib/js/jsxPPXReactSupport.js lib/js/lazy.js lib/js/lexing.js lib/js/list.js @@ -887,42 +879,26 @@ lib/ocaml/js_weakset.cmi lib/ocaml/js_weakset.cmj lib/ocaml/js_weakset.cmt lib/ocaml/js_weakset.res -lib/ocaml/jsxC.cmi -lib/ocaml/jsxC.cmj -lib/ocaml/jsxC.cmt -lib/ocaml/jsxC.res -lib/ocaml/jsxDOMC.cmi -lib/ocaml/jsxDOMC.cmj -lib/ocaml/jsxDOMC.cmt -lib/ocaml/jsxDOMC.res +lib/ocaml/jsx.cmi +lib/ocaml/jsx.cmj +lib/ocaml/jsx.cmt +lib/ocaml/jsx.res +lib/ocaml/jsxDOM.cmi +lib/ocaml/jsxDOM.cmj +lib/ocaml/jsxDOM.cmt +lib/ocaml/jsxDOM.res lib/ocaml/jsxDOMStyle.cmi lib/ocaml/jsxDOMStyle.cmj lib/ocaml/jsxDOMStyle.cmt lib/ocaml/jsxDOMStyle.res -lib/ocaml/jsxDOMU.cmi -lib/ocaml/jsxDOMU.cmj -lib/ocaml/jsxDOMU.cmt -lib/ocaml/jsxDOMU.res -lib/ocaml/jsxEventC.cmi -lib/ocaml/jsxEventC.cmj -lib/ocaml/jsxEventC.cmt -lib/ocaml/jsxEventC.res -lib/ocaml/jsxEventU.cmi -lib/ocaml/jsxEventU.cmj -lib/ocaml/jsxEventU.cmt -lib/ocaml/jsxEventU.res -lib/ocaml/jsxPPXReactSupportC.cmi -lib/ocaml/jsxPPXReactSupportC.cmj -lib/ocaml/jsxPPXReactSupportC.cmt -lib/ocaml/jsxPPXReactSupportC.res -lib/ocaml/jsxPPXReactSupportU.cmi -lib/ocaml/jsxPPXReactSupportU.cmj -lib/ocaml/jsxPPXReactSupportU.cmt -lib/ocaml/jsxPPXReactSupportU.res -lib/ocaml/jsxU.cmi -lib/ocaml/jsxU.cmj -lib/ocaml/jsxU.cmt -lib/ocaml/jsxU.res +lib/ocaml/jsxEvent.cmi +lib/ocaml/jsxEvent.cmj +lib/ocaml/jsxEvent.cmt +lib/ocaml/jsxEvent.res +lib/ocaml/jsxPPXReactSupport.cmi +lib/ocaml/jsxPPXReactSupport.cmj +lib/ocaml/jsxPPXReactSupport.cmt +lib/ocaml/jsxPPXReactSupport.res lib/ocaml/lazy.cmi lib/ocaml/lazy.cmj lib/ocaml/lazy.cmt From 1405683c7c923c08c8243e2550bed901dac20ad5 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 20 Jul 2024 08:09:38 +0200 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c19e2b500..1b138ecb46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ - Ignore `-uncurried` command-line flag. https://github.com/rescript-lang/rescript-compiler/pull/6885 - Cleanup: remove tracking of uncurried state in parser/printer. https://github.com/rescript-lang/rescript-compiler/pull/6888 - Remove `%opaque` primitive. https://github.com/rescript-lang/rescript-compiler/pull/6892 +- Reunify JsxC/JsxU -> Jsx etc. https://github.com/rescript-lang/rescript-compiler/pull/6895 #### :nail_care: Polish