Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 26 forks source link

compilationLevel ADVANCED_OPTIMIZATIONS #262

Open wowoName opened 2 months ago

wowoName commented 2 months ago

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(); b

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

niloc132 commented 2 months ago

Can you clarify what you mean by "it doesn't work" - the data is missing, the JS is incorrect, etc? Maybe share some code snippets as text instead of images?

Any other errors/warnings when compiling? it doesn't look correct to use goog.require to reference a class compiled by j2cl - should be goog.module.get() instead probably (since they are registered with goog.module, not goog.provides).

Also, I don't yet understand the use case, but externs might be more correct than exports, if the JS isnt being exported correctly.

treblereel commented 2 months ago

@niloc132 I would like to have some details about goog.exportSymbol

wowoName commented 2 months ago

What I mean by not working is when I execute code in the browser console clientCore.getActiveUnits()[0].getSideName(); A message is displayed indicating that the current method does not exist。 df9438a944dc1a74cd27d0acee14c287

treblereel commented 2 months ago

@wowoName i see, it's quite complex topic, I suggest you to take a look at https://github.com/treblereel/gwt3-processors @GWT3Export section. It might help you export your type into js.

ps. if you have any q, you can reach me out at Vertispan/j2cl channel at element

wowoName commented 2 months ago

@treblereel I joined in the project 'org. Treblereel. J2cl. Processors' At the same time, adding the comment @GWT3Export to the 'getSideName' method can compile and package normally, and the compiled package is no different from the previous one. Next do not know how to change the modification ~ 1714469060573

wowoName commented 2 months ago

1714469060573