Wednesday, June 27, 2012

Re: Will ClientBundle work when I allow people to embed my app in their site?

CssResource: works as its inlined into your JavaScript to avoid round trip times.

ImageResource: should work as you typically use it with GWT's @Sprite in CSS or in combination with GWT's Image class. In both cases the image will be loaded via CSS background-image: url(<imageUrl>) => no SOP.

DataResource: With DataResource you only have DataResource.getUrl() to access it. So it depends on yourself and how you load the url. If you load it via XHR you have a SOP problem. But if its for example a custom mouse cursor and you set the url to CSS cursor:url(<url>) its not a problem.

TextResource: Are inlined into your JS and should work, but there is a max limit in text size (see: TextResourceGenerator.MAX_STRING_CHUNK and its JavaDoc).

ExternalTextResource: Are loaded async (XHR) and wouldn't work but it seems like there is a configuration property that tells GWT to load the ExternalTextResource via JSONP (see: ExternalTextResourceGenerator.USE_JSONP and its JavaDoc). So you would use <set-configuration-property name="ExternalTextResource.useJsonp" value="true" /> in your module.gwt.xml.


Also you should be able to test all this very easily by creating a mini project only containing a ClientBundle and some code which uses it, compile it and load it from a different domain. E.g. serve it from localhost and access it from 127.0.0.1 or edit your systems hosts file and add some more domain names for your local host, e.g. 127.0.0.1 localhost test-domain1.com test-domain2.com.


-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/qkSCW4jdvGUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate