-
Notifications
You must be signed in to change notification settings - Fork 19
[MOO-2205] Update RN version to 0.78.2 #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,11 +164,16 @@ class MxGenerator extends Generator { | |
| `src/ui/styles.${this.widget.fileExtension}` | ||
| ); | ||
| } | ||
|
|
||
| if (this.widget.isPlatformNative && this.widget.isLanguageTS) { | ||
| this._copyFile("commons/react-native-compat.d.ts", "typings/react-native-compat.d.ts"); | ||
| } | ||
| } | ||
|
|
||
| _writeCompilerOptions() { | ||
| if (this.widget.isLanguageTS) { | ||
| this._copyFile("commons/tsconfig.json", "tsconfig.json"); | ||
| this._copyFile("commons/react-jsx.d.ts", "typings/react-jsx.d.ts"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can limit this to just native widgets? |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import type * as React from "react"; | ||
|
|
||
| // Ensure global JSX namespace is defined for TS projects using React 19 types. | ||
| declare global { | ||
| namespace JSX { | ||
| interface IntrinsicElements extends React.JSX.IntrinsicElements {} | ||
| interface Element extends React.JSX.Element {} | ||
| interface ElementClass extends React.JSX.ElementClass {} | ||
| interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} | ||
| interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} | ||
| type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>; | ||
| } | ||
| } | ||
|
|
||
| export {}; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import "react"; | ||
|
|
||
| // React Native 0.78.x types expect a `refs` property on class components. | ||
| // React 19 removed `refs` from the Component instance type, so we re-add it here | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there specific dependencies that refer to this.refs? Won't it "explode" in runtime when code assuming Maybe to ensure widget developers don't accidentally use it we can mark it |
||
| // to keep JSX element compatibility for native widgets. | ||
| declare module "react" { | ||
| interface Component<P = {}, S = {}, SS = any> { | ||
| refs?: Record<string, unknown>; | ||
| } | ||
| } | ||
|
|
||
| declare namespace JSX { | ||
| interface ElementClass { | ||
| refs?: Record<string, unknown>; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| { | ||
| "extends": "@mendix/pluggable-widgets-tools/configs/tsconfig.base", | ||
| "compilerOptions": { | ||
| "baseUrl": "./" | ||
| "baseUrl": "./", | ||
| "types": ["jest", "node", "react", "react-dom"], | ||
| "typeRoots": ["./node_modules/@types", "./typings"] | ||
| }, | ||
| "include": ["./src", "./typings"] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the last call to
fixPackageJson()which is now unused, but has changes in this PR. Should we remove the method entirely?