@@ -53,10 +53,10 @@ public class GraphiQLController {
5353 @ Value ("${graphiql.pageTitle:GraphiQL}" )
5454 private String pageTitle ;
5555
56- @ Value ("${graphiql.cdn.enabled:false }" )
56+ @ Value ("${graphiql.cdn.enabled:true }" )
5757 private Boolean graphiqlCdnEnabled ;
5858
59- @ Value ("${graphiql.cdn.version:0.12 .0}" )
59+ @ Value ("${graphiql.cdn.version:0.13 .0}" )
6060 private String graphiqlCdnVersion ;
6161
6262 @ Value ("${graphiql.subscriptions.timeout:30}" )
@@ -121,41 +121,41 @@ private Map<String, String> getReplacements(String graphqlEndpoint, String subsc
121121 replacements .put ("staticBasePath" , staticBasePath );
122122 replacements .put ("pageTitle" , pageTitle );
123123 replacements .put ("es6PromiseJsUrl" , getCdnJsUrl (staticBasePath , graphiqlCdnEnabled , ES_6_PROMISE ,
124- "4.1.1" , "es6-promise.auto.min.js" ));
124+ "4.1.1" , "es6-promise.auto.min.js" , "es6-promise.auto.min.js" ));
125125 replacements .put ("fetchJsUrl" , getCdnJsUrl (staticBasePath , graphiqlCdnEnabled , FETCH ,
126- "3 .0.0 " , "fetch.min.js" ));
126+ "2 .0.4" , "fetch.min.js " , "fetch.min.js" ));
127127 replacements .put ("reactJsUrl" , getCdnJsUrl (staticBasePath , graphiqlCdnEnabled , REACT ,
128- "16.8.3" , "react.production.min.js" ));
128+ "16.8.3" , "umd/ react.production.min.js" , "react .min.js" ));
129129 replacements .put ("reactDomJsUrl" , getCdnJsUrl (staticBasePath , graphiqlCdnEnabled , REACT_DOM ,
130- "16.8.3" , "react-dom.production.min.js" ));
131- replacements .put ("graphiqlCssUrl" , getCdnJsUrl (staticBasePath , graphiqlCdnEnabled , GRAPHIQL ,
132- graphiqlCdnVersion , "graphiql.min.css" ));
133- replacements .put ("graphiqlJsUrl" , getCdnJsUrl (staticBasePath , graphiqlCdnEnabled , GRAPHIQL ,
134- graphiqlCdnVersion , "graphiql.min.js" ));
130+ "16.8.3" , "umd/ react-dom.production.min.js" , "react-dom .min.js" ));
131+ replacements .put ("graphiqlCssUrl" , getJsDelivrUrl (staticBasePath , graphiqlCdnEnabled , GRAPHIQL ,
132+ graphiqlCdnVersion , "graphiql.css" , "graphiql. min.css" ));
133+ replacements .put ("graphiqlJsUrl" , getJsDelivrUrl (staticBasePath , graphiqlCdnEnabled , GRAPHIQL ,
134+ graphiqlCdnVersion , "graphiql.min.js" , "graphiql.min.js" ));
135135 replacements .put ("subscriptionsTransportWsBrowserClient" , getJsDelivrUrl (staticBasePath , graphiqlCdnEnabled ,
136- SUBSCRIPTIONS_TRANSPORT_WS , "@ 0.9.15" , "browser/client.js" ,
137- "subscriptions-transport-ws-browser-client-0.9.15 .js" ));
136+ SUBSCRIPTIONS_TRANSPORT_WS , "0.9.15" , "browser/client.js" ,
137+ "subscriptions-transport-ws-browser-client.js" ));
138138 replacements .put ("graphiqlSubscriptionsFetcherBrowserClient" , getJsDelivrUrl (staticBasePath , graphiqlCdnEnabled ,
139- GRAPHIQL_SUBSCRIPTIONS_FETCHER , "@ 0.0.2" , "browser/client.js" ,
140- "graphiql-subscriptions-fetcher-browser-client-0.0.2 .js" ));
139+ GRAPHIQL_SUBSCRIPTIONS_FETCHER , "0.0.2" , "browser/client.js" ,
140+ "graphiql-subscriptions-fetcher-browser-client.js" ));
141141 replacements .put ("props" , props );
142142 replacements .put ("headers" , headers );
143143 replacements .put ("subscriptionClientTimeout" , String .valueOf (subscriptionsTimeout ));
144144 return replacements ;
145145 }
146146
147147 private String getCdnJsUrl (String staticBasePath , Boolean isCdnEnabled , String library ,
148- String cdnVersion , String filename ) {
148+ String cdnVersion , String cdnFileName , String filename ) {
149149 if (isCdnEnabled && StringUtils .isNotBlank (cdnVersion )) {
150- return CDNJS_CLOUDFLARE_COM_AJAX_LIBS + library + cdnVersion + "/" + filename ;
150+ return CDNJS_CLOUDFLARE_COM_AJAX_LIBS + library + "/" + cdnVersion + "/" + cdnFileName ;
151151 }
152152 return staticBasePath + "vendor/" + filename ;
153153 }
154154
155155 private String getJsDelivrUrl (String staticBasePath , Boolean isCdnEnabled , String library ,
156156 String cdnVersion , String cdnFileName , String filename ) {
157157 if (isCdnEnabled && StringUtils .isNotBlank (cdnVersion )) {
158- return CDN_JSDELIVR_NET_NPM + library + "/ " + cdnVersion + "/" + cdnFileName ;
158+ return CDN_JSDELIVR_NET_NPM + library + "@ " + cdnVersion + "/" + cdnFileName ;
159159 }
160160 return staticBasePath + "vendor/" + filename ;
161161 }
0 commit comments