rip-lang 3.13.14 → 3.13.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/dist/rip.js +19 -6
- package/docs/dist/rip.min.js +157 -157
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/app.rip +15 -3
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/app.rip
CHANGED
|
@@ -910,9 +910,21 @@ export launch = (appBase = '', opts = {}) ->
|
|
|
910
910
|
if opts.bundle
|
|
911
911
|
bundle = opts.bundle
|
|
912
912
|
else if opts.bundleUrl
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
913
|
+
headers = {}
|
|
914
|
+
etagKey = "__rip_etag_#{opts.bundleUrl}"
|
|
915
|
+
cached = sessionStorage.getItem(etagKey)
|
|
916
|
+
headers['If-None-Match'] = cached if cached
|
|
917
|
+
res = await fetch(opts.bundleUrl, { headers })
|
|
918
|
+
if res.status is 304
|
|
919
|
+
bundle = JSON.parse(sessionStorage.getItem("#{etagKey}_data"))
|
|
920
|
+
else if res.ok
|
|
921
|
+
bundle = res.json!
|
|
922
|
+
etag = res.headers.get('etag')
|
|
923
|
+
if etag
|
|
924
|
+
sessionStorage.setItem(etagKey, etag)
|
|
925
|
+
sessionStorage.setItem("#{etagKey}_data", JSON.stringify(bundle))
|
|
926
|
+
else
|
|
927
|
+
throw new Error "launch: #{opts.bundleUrl} (#{res.status})"
|
|
916
928
|
else
|
|
917
929
|
throw new Error "launch: no bundle or bundleUrl provided"
|
|
918
930
|
|