Skip to content
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

compilationLevel ADVANCED_OPTIMIZATIONS #660

Open
wowoName opened this issue Apr 29, 2024 · 11 comments
Open

compilationLevel ADVANCED_OPTIMIZATIONS #660

wowoName opened this issue Apr 29, 2024 · 11 comments

Comments

@wowoName
Copy link

I had a problem when using ADVANCED_OPTIMIZATIONS to build again. I want properties and methods in a class in java not to be confused Delete how I set them. Thank you very much

@mP1
Copy link
Owner

mP1 commented Apr 29, 2024

I want properties and methods in a class in java not to be confused Delete how I set them. Thank you very much

Are you trying to access the same properties/fields from your "java class" by javascript ?

https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJsInterop.html

@wowoName
Copy link
Author

wowoName commented Apr 29, 2024 via email

@mP1
Copy link
Owner

mP1 commented Apr 29, 2024

Im not quite sure what your problem is, i dont understand exactly what "confused Delete how i set them" means.

@wowoName
Copy link
Author

I'm sorry I wasn't accurate, but here's what my code looks like。
This code should work in the browser console
a
But when I call the 'getSideName' method in 'ActiveUnitAgent' through the call console with the data I got in step 1, it doesn't work.
code:
clientCore.getActiveUnits()[0].getSideName();

How should I modify it? Thank you very much!!!

@wowoName
Copy link
Author

b

@mP1
Copy link
Owner

mP1 commented Apr 30, 2024

Sounds like perhaps you have discovered some sort of Closure bug.

But first, within the browser debugger can you paste all the properties on the ActiveUnitAgent object itself when the debugger fails. Just wondering if the object is actually a ActiveUnitAgent in this scope. You did confirm it works fine without ADVANCED - so theoretically it should just work if understand whats happened.

@wowoName
Copy link
Author

Changing to SIMPLE_OPTIMIZATIONS using compile mode will work fine. After the search data can be exported in the.js file by the desired method can work。
goog.exportSymbol('ActiveUnitAgent.prototype.getUnitClass', ActiveUnitAgent.prototype.getUnitClass);

Is there any other easy way to derive the desired method instead of listing it

1 similar comment
@wowoName
Copy link
Author

Changing to SIMPLE_OPTIMIZATIONS using compile mode will work fine. After the search data can be exported in the.js file by the desired method can work。
goog.exportSymbol('ActiveUnitAgent.prototype.getUnitClass', ActiveUnitAgent.prototype.getUnitClass);

Is there any other easy way to derive the desired method instead of listing it

@mP1
Copy link
Owner

mP1 commented Apr 30, 2024

Changing to SIMPLE_OPTIMIZATIONS using compile mode will work fine. After the search data can be exported in the.js file by the desired method can work。
goog.exportSymbol('ActiveUnitAgent.prototype.getUnitClass', ActiveUnitAgent.prototype.getUnitClass);

Q1. did you add the goog.exportSymbol now ?
Q2: Is it working now ?

Is there any other easy way to derive the desired method instead of listing it
I was hoping you can confirm if the object is actually a ActiveUnitAgent by looking a the other props, so we can understand if the sideName is the only problem.

@mP1
Copy link
Owner

mP1 commented Apr 30, 2024

How did you fix your problem ?

@mP1 mP1 reopened this Apr 30, 2024
@wowoName
Copy link
Author

Changing to SIMPLE_OPTIMIZATIONS is more reliable when compiling mode。
Or export the method you want to call in.js
goog.exportSymbol('ActiveUnitAgent.prototype.getSideName', ActiveUnitAgent.prototype.getSideName);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants