Search code examples
javagwtclientbundle

ClientBundle.enableInlining and ClientBundle.enableRenaming?


I recently read this article on ClientBundle and under the Levers and knobs section, see these two entries:

  • ClientBundle.enableInlining is a deferred-binding property that can be used to disable the use of data: URLs in browsers that would otherwise support inlining resource data into the compiled JS.
  • ClientBundle.enableRenaming is a configuration property that will disable the use of strongly-named cache files.

I'm having a tough time visualizing these in action and understanding what they do. Where do you set these properties? Why would you set them (i.e., when would I want to "disable the use of data", or "disable the use of strongly-named cache files")? Can someone provide a real-world use case and perhaps some code snippets for me? Thanks in advance!


Solution

  • Where do you set these properties?

    Deferred-binding properties are set in your gwt.xml with <set-property>.
    See https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsDeferred

    Why would you set them (i.e., when would I want to "disable the use of data", or "disable the use of strongly-named cache files")?

    For debugging, or if the performance boost they're supposed to bring to your app actually does more harm than good (enableInlining'), or if you need/want to share the resources with other scripts/apps (enableRenaming`).

    Can someone provide a real-world use case and perhaps some code snippets for me?

    You'll know it when you need them. Until then, ignore them.