@octanejs/codemod 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,416 @@
1
+ /**
2
+ * What each React module name means in Octane.
3
+ *
4
+ * Values and types are listed separately because Octane exports React's type
5
+ * names as migration aliases (`ReactNode`, `ChangeEvent`, `FC`, ...), while
6
+ * several React values have no Octane counterpart at all and need a rewrite or a
7
+ * person (`forwardRef`, class components, `createRef`).
8
+ */
9
+
10
+ /** React value exports that exist in `octane` under the same name. */
11
+ const OCTANE_VALUES = new Set([
12
+ 'Activity',
13
+ 'Children',
14
+ 'Fragment',
15
+ 'StrictMode',
16
+ 'Suspense',
17
+ 'ViewTransition',
18
+ 'act',
19
+ 'addTransitionType',
20
+ 'cloneElement',
21
+ 'createContext',
22
+ 'createElement',
23
+ 'createPortal',
24
+ 'createRoot',
25
+ 'flushSync',
26
+ 'hydrateRoot',
27
+ 'isValidElement',
28
+ 'lazy',
29
+ 'memo',
30
+ 'preconnect',
31
+ 'prefetchDNS',
32
+ 'preinit',
33
+ 'preinitModule',
34
+ 'preload',
35
+ 'preloadModule',
36
+ 'requestFormReset',
37
+ 'startTransition',
38
+ 'unstable_Activity',
39
+ 'unstable_ViewTransition',
40
+ 'unstable_addTransitionType',
41
+ 'unstable_batchedUpdates',
42
+ 'use',
43
+ 'useActionState',
44
+ 'useCallback',
45
+ 'useContext',
46
+ 'useDebugValue',
47
+ 'useDeferredValue',
48
+ 'useEffect',
49
+ 'useEffectEvent',
50
+ 'useFormState',
51
+ 'useFormStatus',
52
+ 'useId',
53
+ 'useImperativeHandle',
54
+ 'useInsertionEffect',
55
+ 'useLayoutEffect',
56
+ 'useMemo',
57
+ 'useOptimistic',
58
+ 'useReducer',
59
+ 'useRef',
60
+ 'useState',
61
+ 'useSyncExternalStore',
62
+ 'useTransition',
63
+ 'version',
64
+ ]);
65
+
66
+ /** `react-dom/server` names served by `octane/server`. */
67
+ const OCTANE_SERVER_VALUES = new Set([
68
+ 'renderToPipeableStream',
69
+ 'renderToReadableStream',
70
+ 'renderToStaticMarkup',
71
+ 'renderToString',
72
+ ]);
73
+
74
+ /** React type names `octane` exports as-is. */
75
+ const OCTANE_TYPES = new Set(
76
+ (
77
+ 'AllHTMLAttributes AnchorHTMLAttributes AnimationEvent AnimationEventHandler AreaHTMLAttributes ' +
78
+ 'AriaAttributes AriaRole Attributes AudioHTMLAttributes BaseHTMLAttributes BlockquoteHTMLAttributes ' +
79
+ 'Booleanish ButtonHTMLAttributes CSSProperties CanvasHTMLAttributes ChangeEvent ChangeEventHandler ' +
80
+ 'ClipboardEvent ClipboardEventHandler ColHTMLAttributes ColgroupHTMLAttributes ComponentProps ' +
81
+ 'ComponentPropsWithRef ComponentPropsWithoutRef ComponentRef ComponentType CompositionEvent ' +
82
+ 'CompositionEventHandler Context ContextType CrossOrigin CustomComponentPropsWithRef DOMAttributes ' +
83
+ 'DOMElement DataHTMLAttributes DelHTMLAttributes DependencyList Destructor DetailedHTMLProps ' +
84
+ 'DetailedReactHTMLElement DetailsHTMLAttributes DialogHTMLAttributes Dispatch DispatchWithoutAction ' +
85
+ 'DragEvent DragEventHandler EffectCallback ElementRef ElementType EmbedHTMLAttributes EventHandler ' +
86
+ 'ExoticComponent FC FieldsetHTMLAttributes FocusEvent FocusEventHandler FormEvent FormEventHandler ' +
87
+ 'FormHTMLAttributes FunctionComponent FunctionComponentElement HTMLAttributeAnchorTarget ' +
88
+ 'HTMLAttributeReferrerPolicy HTMLAttributes HTMLInputTypeAttribute HTMLProps HtmlHTMLAttributes ' +
89
+ 'IframeHTMLAttributes ImgHTMLAttributes InputEvent InputEventHandler InputHTMLAttributes ' +
90
+ 'InsHTMLAttributes InvalidEvent InvalidEventHandler JSX JSXElementConstructor Key KeyboardEvent ' +
91
+ 'KeyboardEventHandler KeygenHTMLAttributes LabelHTMLAttributes LazyExoticComponent LiHTMLAttributes ' +
92
+ 'LinkHTMLAttributes MapHTMLAttributes MemoExoticComponent MenuHTMLAttributes MetaHTMLAttributes ' +
93
+ 'MeterHTMLAttributes MouseEvent MouseEventHandler MutableRefObject NamedExoticComponent ' +
94
+ 'ObjectHTMLAttributes OlHTMLAttributes OptgroupHTMLAttributes OptionHTMLAttributes ' +
95
+ 'OutputHTMLAttributes ParamHTMLAttributes PointerEvent PointerEventHandler ProgressHTMLAttributes ' +
96
+ 'PropsWithChildren PropsWithRef PropsWithoutRef Provider ProviderProps QuoteHTMLAttributes ' +
97
+ 'ReactElement ReactHTMLElement ReactNode ReactPortal ReactSVGElement Reducer ReducerAction ' +
98
+ 'ReducerState ReducerStateWithoutAction ReducerWithoutAction Ref RefAttributes RefCallback RefObject ' +
99
+ 'SVGAttributes SVGLineElementAttributes SVGProps SVGTextElementAttributes ScriptHTMLAttributes ' +
100
+ 'SelectHTMLAttributes SetStateAction SlotHTMLAttributes SourceHTMLAttributes StrictModeProps ' +
101
+ 'StyleHTMLAttributes SuspenseProps TableHTMLAttributes TdHTMLAttributes TextareaHTMLAttributes ' +
102
+ 'ThHTMLAttributes TimeHTMLAttributes ToggleEvent ToggleEventHandler TouchEvent TouchEventHandler ' +
103
+ 'TrackHTMLAttributes TransitionEvent TransitionEventHandler UIEvent UIEventHandler ' +
104
+ 'VideoHTMLAttributes WebViewHTMLAttributes WheelEvent WheelEventHandler'
105
+ ).split(' '),
106
+ );
107
+
108
+ /**
109
+ * React type names with an Octane spelling of their own. `ReactNode` keeps its
110
+ * alias when imported by name, so only namespace-qualified uses change; the
111
+ * rest have no alias in Octane.
112
+ *
113
+ * @type {Record<string, string>}
114
+ */
115
+ const RENAMED_TYPES = {
116
+ BaseSyntheticEvent: 'NativeEvent',
117
+ ForwardRefExoticComponent: 'FC',
118
+ ForwardedRef: 'Ref',
119
+ LegacyRef: 'Ref',
120
+ ReactChild: 'OctaneNode',
121
+ ReactFragment: 'OctaneNode',
122
+ ReactText: 'OctaneNode',
123
+ SyntheticEvent: 'NativeEvent',
124
+ };
125
+
126
+ /** Namespace-qualified spellings that read better as Octane's own name. *
127
+ * @type {Record<string, string>}
128
+ */
129
+ const QUALIFIED_TYPE_PREFERENCES = {
130
+ ReactElement: 'OctaneElement',
131
+ ReactNode: 'OctaneNode',
132
+ };
133
+
134
+ /** Modules whose imports this codemod owns, and the Octane module each becomes. *
135
+ * @type {Record<string, string>}
136
+ */
137
+ export const REACT_MODULES = {
138
+ react: 'octane',
139
+ 'react-dom': 'octane',
140
+ 'react-dom/client': 'octane',
141
+ 'react-dom/server': 'octane/server',
142
+ 'react-dom/server.browser': 'octane/server',
143
+ 'react-dom/server.bun': 'octane/server',
144
+ 'react-dom/server.edge': 'octane/server',
145
+ 'react-dom/server.node': 'octane/server',
146
+ 'react-dom/test-utils': 'octane',
147
+ 'react/jsx-runtime': 'octane/jsx-runtime',
148
+ 'react/jsx-dev-runtime': 'octane/jsx-dev-runtime',
149
+ // React's `useSyncExternalStore` for React 17 and earlier.
150
+ 'use-sync-external-store': 'octane',
151
+ 'use-sync-external-store/shim': 'octane',
152
+ };
153
+
154
+ /**
155
+ * What `@octanejs/radix` exports in each namespace. A namespace ports the
156
+ * `@radix-ui/react-*` package it names, as `Dialog` ports
157
+ * `@radix-ui/react-dialog`, except `Slot`, whose exports are the binding's own.
158
+ * A codemod test checks it against the binding and the Radix packages.
159
+ *
160
+ * @type {Record<string, Set<string>>}
161
+ */
162
+ const RADIX = Object.fromEntries(
163
+ Object.entries({
164
+ AccessibleIcon: 'AccessibleIcon Root',
165
+ Accordion: 'Accordion Content Header Item Root Trigger createAccordionScope',
166
+ AlertDialog:
167
+ 'Action AlertDialog Cancel Content Description Overlay Portal Root Title Trigger createAlertDialogScope',
168
+ Arrow: 'Arrow Root',
169
+ AspectRatio: 'AspectRatio Root',
170
+ Avatar: 'Avatar AvatarFallback AvatarImage Fallback Image Root createAvatarScope',
171
+ Checkbox:
172
+ 'BubbleInput Checkbox CheckboxBubbleInput CheckboxIndicator CheckboxProvider CheckboxTrigger CheckedState Indicator Provider Root Trigger createCheckboxScope',
173
+ Collapsible:
174
+ 'Collapsible Content Root Trigger createCollapsibleContext createCollapsibleScope useCollapsibleContext',
175
+ ContextMenu:
176
+ 'Arrow CheckboxItem Content ContextMenu ContextMenuContent ContextMenuItem ContextMenuTrigger Group Item ItemIndicator Label Portal RadioGroup RadioItem Root Separator Sub SubContent SubTrigger Trigger createContextMenuScope',
177
+ Dialog:
178
+ 'Close Content Description Dialog Overlay Portal Root Title Trigger createDialogContext createDialogScope',
179
+ Direction: 'DirectionProvider Provider useDirection',
180
+ DropdownMenu:
181
+ 'Arrow CheckboxItem Content DropdownMenu DropdownMenuContent DropdownMenuItem DropdownMenuTrigger Group Item ItemIndicator Label Portal RadioGroup RadioItem Root Separator Sub SubContent SubTrigger Trigger createDropdownMenuScope',
182
+ Form: 'Control Field Form FormControl FormField FormLabel FormMessage FormSubmit FormValidityState Label Message Root Submit ValidityState createFormScope',
183
+ HoverCard:
184
+ 'Arrow Content HoverCard HoverCardContent HoverCardTrigger Portal Root Trigger createHoverCardScope',
185
+ Label: 'Label Root',
186
+ Menu: 'Anchor Arrow CheckboxItem Content Group Item ItemIndicator Label Menu MenuAnchor MenuContent MenuItem Portal RadioGroup RadioItem Root Separator Sub SubContent SubTrigger createMenuScope',
187
+ Menubar:
188
+ 'Arrow CheckboxItem Content Group Item ItemIndicator Label Menu Menubar MenubarArrow MenubarCheckboxItem MenubarContent MenubarGroup MenubarItem MenubarItemIndicator MenubarLabel MenubarMenu MenubarPortal MenubarRadioGroup MenubarRadioItem MenubarSeparator MenubarSub MenubarSubContent MenubarSubTrigger MenubarTrigger Portal RadioGroup RadioItem Root Separator Sub SubContent SubTrigger Trigger createMenubarScope',
189
+ NavigationMenu:
190
+ 'Content Indicator Item Link List NavigationMenu NavigationMenuContent NavigationMenuIndicator NavigationMenuItem NavigationMenuLink NavigationMenuList NavigationMenuSub NavigationMenuTrigger NavigationMenuViewport Root Sub Trigger Viewport createNavigationMenuScope',
191
+ OneTimePasswordField:
192
+ 'HiddenInput Input InputValidationType OneTimePasswordField OneTimePasswordFieldHiddenInput OneTimePasswordFieldInput Root createOneTimePasswordFieldScope',
193
+ PasswordToggleField:
194
+ 'Icon Input PasswordToggleField PasswordToggleFieldIcon PasswordToggleFieldInput PasswordToggleFieldSlot PasswordToggleFieldToggle Root Slot Toggle createPasswordToggleFieldScope',
195
+ Popover:
196
+ 'Anchor Arrow Close Content Popover PopoverAnchor PopoverTrigger Portal Root Trigger createPopoverScope',
197
+ Popper:
198
+ 'ALIGN_OPTIONS Anchor Arrow Content Popper PopperAnchor PopperArrow PopperContent Root SIDE_OPTIONS createPopperScope',
199
+ Portal: 'Portal Root',
200
+ Progress: 'Indicator Progress ProgressIndicator Root createProgressScope',
201
+ RadioGroup:
202
+ 'Indicator Item RadioGroup RadioGroupIndicator RadioGroupItem RadioGroupItemBubbleInput RadioGroupItemProvider RadioGroupItemTrigger Root createRadioGroupScope',
203
+ RovingFocus:
204
+ 'Item Root RovingFocusGroup RovingFocusGroupItem createRovingFocusGroupContext createRovingFocusGroupScope',
205
+ ScrollArea:
206
+ 'Corner Root ScrollArea ScrollAreaCorner ScrollAreaScrollbar ScrollAreaThumb ScrollAreaViewport Scrollbar Thumb Viewport createScrollAreaScope',
207
+ Select:
208
+ 'Arrow BubbleInput Content Group Icon Item ItemIndicator ItemText Label Portal Provider Root ScrollDownButton ScrollUpButton Select SelectArrow SelectBubbleInput SelectContent SelectGroup SelectIcon SelectItem SelectItemIndicator SelectItemText SelectLabel SelectPortal SelectProvider SelectScrollDownButton SelectScrollUpButton SelectSeparator SelectTrigger SelectValue SelectViewport Separator Trigger Value Viewport createSelectScope',
209
+ Separator: 'Root Separator',
210
+ Slider:
211
+ 'BubbleInput Range Root Slider SliderBubbleInput SliderRange SliderThumb SliderThumbProvider SliderThumbTrigger SliderTrack Thumb Track createSliderScope',
212
+ Slot: 'Slot Slottable',
213
+ Switch:
214
+ 'BubbleInput Provider Root Switch SwitchBubbleInput SwitchProvider SwitchThumb SwitchTrigger Thumb Trigger createSwitchScope',
215
+ Tabs: 'Content List Root Tabs Trigger createTabsScope',
216
+ Toast:
217
+ 'Action Close Description Provider Root Title Toast ToastAction ToastClose ToastDescription ToastProvider ToastTitle ToastViewport Viewport createToastScope',
218
+ Toggle: 'Root Toggle',
219
+ ToggleGroup: 'Item Root ToggleGroup ToggleGroupItem createToggleGroupScope',
220
+ Toolbar:
221
+ 'Button Link Root Separator ToggleGroup ToggleItem Toolbar ToolbarButton ToolbarLink createToolbarScope',
222
+ Tooltip:
223
+ 'Arrow Content Portal Provider Root Tooltip TooltipProvider Trigger createTooltipScope',
224
+ VisuallyHidden: 'Root VISUALLY_HIDDEN_STYLES VisuallyHidden',
225
+ }).map(([namespace, names]) => [namespace, new Set(names.split(' '))]),
226
+ );
227
+
228
+ /** The types among them, which a named import reads as an alias, not a value. */
229
+ export const RADIX_TYPES = new Set(['CheckedState', 'InputValidationType']);
230
+
231
+ /** Each Radix package the binding ports, and its namespace. */
232
+ const RADIX_PACKAGES = new Map(
233
+ Object.keys(RADIX).map((namespace) => [
234
+ `@radix-ui/react-${namespace.replace(/[A-Z]/g, (c, i) => (i ? '-' : '') + c.toLowerCase())}`,
235
+ namespace,
236
+ ]),
237
+ );
238
+
239
+ /**
240
+ * The adapters TanStack publishes for Octane, by the React adapter each
241
+ * replaces, with the exports each lacks and what to do instead.
242
+ *
243
+ * @type {Record<string, Record<string, string>>}
244
+ */
245
+ const TANSTACK_ADAPTERS = {
246
+ '@tanstack/react-hotkeys': {},
247
+ '@tanstack/react-pacer': {
248
+ usePacerContext:
249
+ "`@tanstack/octane-pacer` has no `usePacerContext`; read the provider's options with `useDefaultPacerOptions()`.",
250
+ },
251
+ '@tanstack/react-table': Object.fromEntries(
252
+ (
253
+ 'getCoreRowModel getExpandedRowModel getFacetedMinMaxValues getFacetedRowModel ' +
254
+ 'getFacetedUniqueValues getFilteredRowModel getGroupedRowModel getPaginationRowModel ' +
255
+ 'getSortedRowModel legacyCreateColumnHelper sortingFns useLegacyTable useReactTable'
256
+ )
257
+ .split(' ')
258
+ .map((name) => [
259
+ name,
260
+ `\`${name}\` is TanStack Table v8's API, which \`@tanstack/octane-table\` does not adapt: move to v9's \`useTable\`, with \`_features\` and \`_rowModels\`, first.`,
261
+ ]),
262
+ ),
263
+ };
264
+
265
+ /**
266
+ * React packages ported outside the binding catalog: a framework integration,
267
+ * TanStack's own adapters, and Radix's primitive packages, which
268
+ * `@octanejs/radix` serves as namespaces.
269
+ */
270
+ export const PORTED_PACKAGES = /** @type {Record<string, string>} */ ({
271
+ '@tanstack/react-start': '@octanejs/tanstack-start',
272
+ ...Object.fromEntries(
273
+ Object.keys(TANSTACK_ADAPTERS).map((name) => [name, name.replace('/react-', '/octane-')]),
274
+ ),
275
+ ...Object.fromEntries([...RADIX_PACKAGES.keys()].map((name) => [name, '@octanejs/radix'])),
276
+ });
277
+
278
+ /**
279
+ * The `@octanejs/radix` namespace a Radix package's imports become, or null.
280
+ * `@radix-ui/react-slot` has none: its exports are the binding's own.
281
+ *
282
+ * @param {string} module
283
+ */
284
+ export function radixNamespace(module) {
285
+ const namespace = RADIX_PACKAGES.get(module) ?? null;
286
+ return namespace === 'Slot' ? null : namespace;
287
+ }
288
+
289
+ /**
290
+ * The name an export of a ported package has in its port, or null when the
291
+ * port has none. Other packages keep every name.
292
+ *
293
+ * @param {string} module
294
+ * @param {string} name
295
+ * @returns {string | null}
296
+ */
297
+ export function mapPackageExport(module, name) {
298
+ const namespace = RADIX_PACKAGES.get(module);
299
+ if (namespace !== undefined) {
300
+ const names = RADIX[namespace];
301
+ if (names.has(name)) return name;
302
+ // Radix exports each part twice, as `Content` and `DialogContent`, with
303
+ // `Root` as `Dialog`, and a part still in preview as `unstable_Content`.
304
+ const prefix = new RegExp(`^(?:unstable_)?(?:${namespace}(?![a-z]))?`);
305
+ const part = (/** @type {string} */ name) => name.replace(prefix, '') || 'Root';
306
+ const wanted = part(name);
307
+ if (names.has(wanted)) return wanted;
308
+ return [...names].find((candidate) => part(candidate) === wanted) ?? null;
309
+ }
310
+ const adapter = adapterOf(module);
311
+ if (adapter === undefined) return name;
312
+ if (Object.hasOwn(adapter, name)) return null;
313
+ // The adapters name their framework in their types: `ReactTable` is `OctaneTable`.
314
+ return name.replace(/React(?=[A-Z])/, 'Octane');
315
+ }
316
+
317
+ /**
318
+ * Why the port of a ported package has no `name`.
319
+ *
320
+ * @param {string} module
321
+ * @param {string} name
322
+ */
323
+ export function missingExport(module, name) {
324
+ const adapter = adapterOf(module);
325
+ if (adapter !== undefined) return adapter[name];
326
+ const namespace = RADIX_PACKAGES.get(module);
327
+ return `\`@octanejs/radix\` has no \`${namespace === 'Slot' ? name : `${namespace}.${name}`}\`.`;
328
+ }
329
+
330
+ /**
331
+ * The TanStack adapter a specifier imports, by its package.
332
+ *
333
+ * @param {string} module
334
+ */
335
+ function adapterOf(module) {
336
+ const name = module.split('/', 2).join('/');
337
+ return Object.hasOwn(TANSTACK_ADAPTERS, name) ? TANSTACK_ADAPTERS[name] : undefined;
338
+ }
339
+
340
+ /**
341
+ * React values with no Octane export, each with what to do instead. A value
342
+ * listed here is never imported from Octane; the codemod either rewrites its
343
+ * uses or reports them.
344
+ *
345
+ * @type {Record<string, string>}
346
+ */
347
+ export const UNSUPPORTED_VALUES = {
348
+ Component: 'Class components are not supported. Convert it to a function component.',
349
+ PureComponent:
350
+ 'Class components are not supported. Convert it to a function component with `memo`.',
351
+ Profiler: 'Octane has no `Profiler`; use the Octane devtools profiler.',
352
+ SuspenseList: 'Octane has no `SuspenseList`.',
353
+ cache: 'Server Components are not supported, so `cache` has no Octane equivalent.',
354
+ cacheSignal: 'Server Components are not supported, so `cacheSignal` has no Octane equivalent.',
355
+ captureOwnerStack: 'Octane does not collect owner stacks.',
356
+ createRef:
357
+ 'Octane has no `createRef`; use `useRef` in a function component or a `{ current: null }` object.',
358
+ findDOMNode: 'Octane has no `findDOMNode`; pass a ref to the host element.',
359
+ forwardRef: 'Refs are props in Octane; the codemod unwraps `forwardRef` where it can.',
360
+ hydrate: 'Legacy roots are not supported; the codemod rewrites calls to `hydrateRoot`.',
361
+ render: 'Legacy roots are not supported; the codemod rewrites calls to `createRoot(...).render`.',
362
+ unmountComponentAtNode:
363
+ 'Legacy roots are not supported; keep the `createRoot` result and call `root.unmount()`.',
364
+ };
365
+
366
+ /**
367
+ * @param {string} module a key of {@link REACT_MODULES}
368
+ * @param {string} name the imported name
369
+ * @param {boolean} typeOnly
370
+ * @returns {{ module: string, name: string } | null} null when Octane has no
371
+ * such export
372
+ */
373
+ export function mapReactImport(module, name, typeOnly) {
374
+ if (module === 'react-dom/server' || module.startsWith('react-dom/server.')) {
375
+ return OCTANE_SERVER_VALUES.has(name) ? { module: 'octane/server', name } : null;
376
+ }
377
+ if (!typeOnly && OCTANE_VALUES.has(name)) return { module: 'octane', name };
378
+ if (OCTANE_TYPES.has(name)) return { module: 'octane', name };
379
+ if (name in RENAMED_TYPES) return { module: 'octane', name: RENAMED_TYPES[name] };
380
+ return null;
381
+ }
382
+
383
+ /**
384
+ * The Octane name for `React.<name>` in a type position.
385
+ *
386
+ * @param {string} name
387
+ * @returns {string | null}
388
+ */
389
+ export function mapQualifiedType(name) {
390
+ if (name in QUALIFIED_TYPE_PREFERENCES) return QUALIFIED_TYPE_PREFERENCES[name];
391
+ if (OCTANE_TYPES.has(name)) return name;
392
+ return RENAMED_TYPES[name] ?? null;
393
+ }
394
+
395
+ /** Built-in hooks whose omitted dependency list Octane infers. *
396
+ * @type {Record<string, number>}
397
+ */
398
+ export const DEPENDENCY_HOOKS = {
399
+ useCallback: 1,
400
+ useEffect: 1,
401
+ useImperativeHandle: 2,
402
+ useInsertionEffect: 1,
403
+ useLayoutEffect: 1,
404
+ useMemo: 1,
405
+ };
406
+
407
+ /** `<input type>` values whose native `change` fires on commit, not per edit. */
408
+ export const TEXT_INPUT_TYPES = new Set([
409
+ 'text',
410
+ 'search',
411
+ 'url',
412
+ 'tel',
413
+ 'password',
414
+ 'email',
415
+ 'number',
416
+ ]);