-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
React Ace and Ace builds #5174
Comments
https://github.com/ajaxorg/ace-builds contains only builds, so I'm moving this issue to the repo with actual ace code https://github.com/ajaxorg/ace |
Hey @jmc420 , this might be caused by the fact that in Ace Suggestion: try to patch react-ace with the change which would make scroller a required @nightwing do you see anything that could prevent us from changing the type of |
Thanks for the reply. The issue is about scroller being optional on line 133 of types.ts in react-ace:
https://github.com/securingsincity/react-ace/blob/main/src/types.ts On line 678 of ace.d.ts scroller is mandatory:
https://github.com/ajaxorg/ace-builds/blob/master/ace.d.ts I checked out react-ace and tried to change scroller so that it is mandatory rather than optional on line 133 of types.ts: https://github.com/securingsincity/react-ace/blob/main/src/types.ts This results in compilation errors in React ace:
if I edit ace.d.ts (within node_modules) and make scroller optional, the error goes away. |
@jmc420 And this is most probably caused by react-ace using a different type for scroller ( |
That does not make any difference. It still complains that scroller is required in VirtualRenderer. |
Since interface IRenderer extends Ace.VirtualRenderer {
placeholderNode?: HTMLDivElement;
} Technically, setting |
This results in compilation errors: src/ace.tsx:558:23 - error TS2339: Property 'scroller' does not exist on type 'VirtualRenderer & IRenderer'.
|
In this case I suggest to create an issue in react-ace, or comment on existing one (if any), since this is not an issue with the type of scroller in ace, but rather a compatibility issue (react-ace did not update it's types after ace v1.5.2 was released on May 30, 2022, which included the types update). Closing this as wontfix. |
There's a conflict between React Ace and ace-builds which is described in this github error:
securingsincity/react-ace#1547
React Aces generates a types.d.ts declaration file that looks like this:
This results in a Typescript error:
The issue is that scroller must either be optional in both or mandatory in both.
If you clone React Ace and make scroller mandatory in types.ts, you then get a compilation in React Ace:
Making scroller optional in ace builds' VirtualRenderer interface fixes the problem.
Would it be possible to make this change to line 677 of ace builds' ace.d.ts?
The text was updated successfully, but these errors were encountered: