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

GWT class changes #2

Closed
jnehlmeier opened this issue Sep 26, 2018 · 5 comments
Closed

GWT class changes #2

jnehlmeier opened this issue Sep 26, 2018 · 5 comments

Comments

@jnehlmeier
Copy link
Member

Wrong code:

  • GWT.create() should be static

Missing but required by GWT Widgets / Tests:

  • GWT.isProdMode()
  • GWT.log(String)
  • GWT.log(String, Throwable)
  • GWT.getModuleName()
  • GWT.getModuleBaseURL()
  • GWT.setUncaughtExceptionHandler
    Maybe add them here as a reminder that these methods are probably needed. isProdMode could be implemented using superdevmode property and GWT.log() could be replaced with java.util.logging emulation at call sites (or just forward to it within GWT class).
@niloc132
Copy link
Contributor

moduleName and moduleBaseURL are probably going to have to be no-op'd, unless we mandate some wrapping code to make a j2cl+closure app "actually gwt". The latter is needed to support things like ClientBundle as well (ping @treblereel) so it knows which directory to read from (and write "artifacts" to...). Standardizing that for "gwt3" outside of gwt-core might make sense, and then have gwt-core either assume the presence of gwt2 or gwt3 wiring to provide that value.

@jnehlmeier
Copy link
Member Author

jnehlmeier commented Sep 26, 2018

GWT widgets itself actually need GWT.getModuleBaseURL() only in a single place for the URL of GWTs clear.cache.gif (ClippedImageImpl). This could be changed to a ClientBundle URL and then let ClientBundle figure it out. Other than that FormPanelTest uses GWT.getModuleBaseURL() to post to some servlet.

GWT.getModuleName() is used in FormPanel to generate an unique form name, even across multiple GWT modules on the same page (something that Document.get().createUniqueId() should probably do as well, but currently doesn't)

GWT.isProdMode() is used in AbsolutePanel in a weird verify method that actually does not verify anything useful (https://github.com/gwtproject/gwt/blob/master/user/src/com/google/gwt/user/client/ui/AbsolutePanel.java#L251) and can likely be deleted. However the method might be useful in general to avoid having superdevmode property checks scattered around in code.

@treblereel
Copy link

@niloc132 thank you for mention me, ClientBundle is extremely useful for @jsinterop components, because it's allow us to hide javascript library from end-user and load it transparently. Please keep it in the name of the light

@niloc132
Copy link
Contributor

For sure it will be kept, its just a question of who starts on it, and when - I don't have time to tackle it in the near future, unless someone else wants me to just "look over their shoulder" while they work, or contract us to get it done sooner.

@niloc132
Copy link
Contributor

Ok, most of this has been addressed in Vertispan@31c11d0 and Vertispan@87d30ac

  • log
  • isProdMode
  • isClient
  • isScript
  • setUncaughtExceptionHandler (hard to test, I did a short manual test once, needs more in depth work)

We can perhaps make a getModuleBaseURL (and getModuleBaseForStaticFiles...?) by doing what the gwt2 linkers would do and read the actual script tag to see where we are attached, but this can be messy. Filed #6 to track this.

Creating a getModuleName is less easy, since it implies that there is a module, or a name - neither of those really make sense in gwt3-land as far as I can tell.

Marking closed, please reopen or comment to discuss further if something is missing/broken.

niloc132 added a commit that referenced this issue May 28, 2020
J2cl doesn't care about this (some kind of bootstrap is required), and
GWT2 will not permit an entrypoint with a package structure other than
com.google.gwt.core.client on it.

Closes #2
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

3 participants