Updated Branches: refs/heads/master 0ec991e06 -> 40de50e43
Remove the application version number from the module base URL Update the documentation for application version number Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/029f52e1 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/029f52e1 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/029f52e1 Branch: refs/heads/master Commit: 029f52e14b53e9c84577b80d5b7fd26f62df4420 Parents: 0ec991e Author: Howard M. Lewis Ship <[email protected]> Authored: Mon Apr 8 11:05:49 2013 -0700 Committer: Howard M. Lewis Ship <[email protected]> Committed: Mon Apr 8 11:05:49 2013 -0700 ---------------------------------------------------------------------- .../java/org/apache/tapestry5/SymbolConstants.java | 14 +++++++------- .../services/javascript/ModuleDispatcher.java | 6 +----- .../services/javascript/ModuleManagerImpl.java | 4 +--- .../apache/tapestry5/services/TapestryModule.java | 3 +-- .../ModuleAssetRequestHandlerTest.groovy | 12 ++++++------ .../javascript/ModuleDispatcherTests.groovy | 12 ++++++------ 6 files changed, 22 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/029f52e1/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java b/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java index 28b84d4..0d671c4 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java @@ -38,7 +38,7 @@ public class SymbolConstants * number of Tapestry behaviors related to performance and security, including how exceptions are * reported, whether far-future expire headers are emitted, whether JavaScript files may be combined, * whether JSON is compressed, whether component field & parameter values are shadowed to instance - * variables (to assist with debugging), and more. + * variables (to assist with debugging), and more. */ public static final String PRODUCTION_MODE = "tapestry.production-mode"; @@ -68,7 +68,7 @@ public class SymbolConstants * Time interval defining how often Tapestry will check for updates to local files (including classes). * Starting with 5.3, this is only used when not running in production mode. The default is "1 s" * (one second), which is appropriate for development. With Tapestry 5.2 and earlier this number - * should be raised in a production environment. + * should be raised in a production environment. */ public static final String FILE_CHECK_INTERVAL = "tapestry.file-check-interval"; @@ -128,11 +128,11 @@ public class SymbolConstants public static final String MIN_GZIP_SIZE = "tapestry.min-gzip-size"; /** - * Version number integrated into URLs for assets. This should be changed for each release, otherwise - * out-of-date files may be used from the client's local cache (due to far-future expired headers). The default - * value is semi-random and different for each execution, which will adversely affect client caching, but is - * reasonable - * for development. + * Version number of the application. Prior to 5.4, this version number was integrated into asset URLs. Starting + * with 5.4, a checksum of the individual asset's content is used instead, and this version number is only used + * for documentation purposes; it appears in the default exception report page, for example. + * <p/> + * The default value is "0.0.1". In 5.3 and earlier, the default value was a random hexadecimal string. * * @see AssetDispatcher * @see AssetPathConstructor http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/029f52e1/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java index 3b2864d..85e2279 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java @@ -14,13 +14,11 @@ package org.apache.tapestry5.internal.services.javascript; -import org.apache.tapestry5.SymbolConstants; import org.apache.tapestry5.internal.services.AssetDispatcher; import org.apache.tapestry5.internal.services.ResourceStreamer; import org.apache.tapestry5.ioc.IOOperation; import org.apache.tapestry5.ioc.OperationTracker; import org.apache.tapestry5.ioc.Resource; -import org.apache.tapestry5.ioc.annotations.Symbol; import org.apache.tapestry5.services.Dispatcher; import org.apache.tapestry5.services.PathConstructor; import org.apache.tapestry5.services.Request; @@ -50,15 +48,13 @@ public class ModuleDispatcher implements Dispatcher public ModuleDispatcher(ModuleManager moduleManager, ResourceStreamer streamer, PathConstructor pathConstructor, - @Symbol(SymbolConstants.APPLICATION_VERSION) - String applicationVersion, OperationTracker tracker) { this.moduleManager = moduleManager; this.streamer = streamer; this.tracker = tracker; - prefix = pathConstructor.constructDispatchPath("modules", applicationVersion, ""); + prefix = pathConstructor.constructDispatchPath("modules", ""); } public boolean dispatch(Request request, Response response) throws IOException http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/029f52e1/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleManagerImpl.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleManagerImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleManagerImpl.java index 13dac35..4bf9597 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleManagerImpl.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleManagerImpl.java @@ -57,8 +57,6 @@ public class ModuleManagerImpl implements ModuleManager private final Map<String, Resource> cache = CollectionFactory.newConcurrentMap(); public ModuleManagerImpl(PathConstructor constructor, - @Symbol(SymbolConstants.APPLICATION_VERSION) - String applicationVersion, AssetSource assetSource, @Path("${" + SymbolConstants.REQUIRE_JS + "}") Asset requireJS, @@ -74,7 +72,7 @@ public class ModuleManagerImpl implements ModuleManager this.globalMessages = globalMessages; this.compactJSON = compactJSON; - this.requireConfig = buildRequireJSConfig(constructor.constructClientPath("modules", applicationVersion, ""), configuration, !productionMode); + this.requireConfig = buildRequireJSConfig(constructor.constructClientPath("modules", ""), configuration, !productionMode); classpathRoot = assetSource.resourceForPath(""); http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/029f52e1/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java index 9af3779..1f03d73 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java @@ -41,7 +41,6 @@ import org.apache.tapestry5.internal.services.ajax.AjaxResponseRendererImpl; import org.apache.tapestry5.internal.services.ajax.MultiZoneUpdateEventResultProcessor; import org.apache.tapestry5.internal.services.linktransform.LinkTransformerImpl; import org.apache.tapestry5.internal.services.linktransform.LinkTransformerInterceptor; -import org.apache.tapestry5.internal.services.messages.ClientLocalizationMessageResource; import org.apache.tapestry5.internal.services.messages.PropertiesFileParserImpl; import org.apache.tapestry5.internal.services.meta.ContentTypeExtractor; import org.apache.tapestry5.internal.services.meta.MetaAnnotationExtractor; @@ -2034,7 +2033,7 @@ public final class TapestryModule Random random = new Random(System.currentTimeMillis()); - configuration.add(SymbolConstants.APPLICATION_VERSION, Long.toHexString(random.nextLong())); + configuration.add(SymbolConstants.APPLICATION_VERSION, "0.0.1"); configuration.add(SymbolConstants.OMIT_GENERATOR_META, false); http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/029f52e1/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleAssetRequestHandlerTest.groovy ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleAssetRequestHandlerTest.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleAssetRequestHandlerTest.groovy index 2ad3b63..3c974b7 100644 --- a/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleAssetRequestHandlerTest.groovy +++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleAssetRequestHandlerTest.groovy @@ -21,11 +21,11 @@ class ModuleAssetRequestHandlerTest extends TestBase { expect(request.getPath()).andReturn path - expect(pc.constructDispatchPath("modules", "123", "")).andReturn "/modules/123/" + expect(pc.constructDispatchPath("modules", "")).andReturn "/modules/" replay() - def handler = new ModuleDispatcher(null, null, pc, "123", new QuietOperationTracker()) + def handler = new ModuleDispatcher(null, null, pc, new QuietOperationTracker()) assertEquals handler.dispatch(request, response), false @@ -39,7 +39,7 @@ class ModuleAssetRequestHandlerTest extends TestBase { "foo", "foo/bar", "" - ].collect({ it -> ["/modules/123/$it"] as Object[] }) as Object[][] + ].collect({ it -> ["/modules/$it"] as Object[] }) as Object[][] } @Test @@ -53,15 +53,15 @@ class ModuleAssetRequestHandlerTest extends TestBase { def response = newMock Response - expect(request.getPath()).andReturn "/modules/123/foo/bar.js" + expect(request.getPath()).andReturn "/modules/foo/bar.js" - expect(pc.constructDispatchPath("modules", "123", "")).andReturn "/modules/123/" + expect(pc.constructDispatchPath("modules", "")).andReturn "/modules/" expect(manager.findResourceForModule("foo/bar")).andReturn null replay() - def handler = new ModuleDispatcher(manager, null, pc, "123", new QuietOperationTracker()) + def handler = new ModuleDispatcher(manager, null, pc, new QuietOperationTracker()) assertEquals handler.dispatch(request, response), false http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/029f52e1/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy index 4d39119..35b407a 100644 --- a/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy +++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy @@ -16,13 +16,13 @@ class ModuleDispatcherTests extends TestBase { def request = newMock Request - expect(pc.constructDispatchPath("modules", "123", "")).andReturn "/modules/123/" + expect(pc.constructDispatchPath("modules", "")).andReturn "/modules/" expect(request.path).andReturn path replay() - def handler = new ModuleDispatcher(null, null, pc, "123", new QuietOperationTracker()) + def handler = new ModuleDispatcher(null, null, pc, new QuietOperationTracker()) assertEquals handler.dispatch(request, null), false @@ -36,7 +36,7 @@ class ModuleDispatcherTests extends TestBase { "foo", "foo/bar", "" - ].collect({ it -> ["/modules/123/$it"] as Object[] }) as Object[][] + ].collect({ it -> ["/modules/$it"] as Object[] }) as Object[][] } @Test @@ -48,15 +48,15 @@ class ModuleDispatcherTests extends TestBase { def request = newMock Request - expect(pc.constructDispatchPath("modules", "123", "")).andReturn "/modules/123/" + expect(pc.constructDispatchPath("modules", "")).andReturn "/modules/" - expect(request.path).andReturn("/modules/123/foo/bar.js") + expect(request.path).andReturn("/modules/foo/bar.js") expect(manager.findResourceForModule("foo/bar")).andReturn null replay() - def handler = new ModuleDispatcher(manager, null, pc, "123", new QuietOperationTracker()) + def handler = new ModuleDispatcher(manager, null, pc, new QuietOperationTracker()) assertEquals handler.dispatch(request, null), false
