Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ dist
dist-ssr
*.local

# Cert
.vscode/https

# Editor directories and files
!.vscode/extensions.json
.idea
Expand All @@ -20,8 +23,8 @@ dist-ssr
*.ntvs*
*.njsproj
*.sln
*.sw?
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
*.sw?
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
"liveServer.settings.mount": [
["/diffle-lang", "./dist"]
],
"liveServer.settings.https": {
"enable": true, //set it true to enable the feature.
// https://www.youtube.com/watch?v=v4jgr0ppw8Q
// https://gist.github.com/prof3ssorSt3v3/edb2632a362b3731274cfab84e9973f9
// start chrome --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://127.0.0.1:5500 "https://127.0.0.1:5500/diffle-lang/"
// start chrome --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://localhost:5500 "https://localhost:5500/diffle-lang/"
"cert": "C:/github/diffle-lang/scripts/https/diffle.crt", //full path
"key": "C:/github/diffle-lang/scripts/https/diffle-privateKey.key", //full path
"passphrase": "diffle"
},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#93e6fc",
"activityBar.background": "#93e6fc",
Expand Down
1 change: 1 addition & 0 deletions dev-dist/registerSW.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions dev-dist/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// If the loader is already loaded, just stop.
if (!self.define) {
let registry = {};

// Used for `eval` and `importScripts` where we can't get script URL by other means.
// In both cases, it's safe to use a global var because those functions are synchronous.
let nextDefineUri;

const singleRequire = (uri, parentUri) => {
uri = new URL(uri + ".js", parentUri).href;
return registry[uri] || (

new Promise(resolve => {
if ("document" in self) {
const script = document.createElement("script");
script.src = uri;
script.onload = resolve;
document.head.appendChild(script);
} else {
nextDefineUri = uri;
importScripts(uri);
resolve();
}
})

.then(() => {
let promise = registry[uri];
if (!promise) {
throw new Error(`Module ${uri} didn’t register its module`);
}
return promise;
})
);
};

self.define = (depsNames, factory) => {
const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
if (registry[uri]) {
// Module is already loading or loaded.
return;
}
let exports = {};
const require = depUri => singleRequire(depUri, uri);
const specialDeps = {
module: { uri },
exports,
require
};
registry[uri] = Promise.all(depsNames.map(
depName => specialDeps[depName] || require(depName)
)).then(deps => {
factory(...deps);
return exports;
});
};
}
define(['./workbox-fda11f75'], (function (workbox) { 'use strict';

self.skipWaiting();
workbox.clientsClaim();

/**
* The precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
workbox.precacheAndRoute([{
"url": "registerSW.js",
"revision": "9826aee49e0d0ee3a1f993c4f91b69bf"
}, {
"url": "index.html",
"revision": "0.q6335uii648"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
allowlist: [/^\/$/]
}));
workbox.registerRoute(({
url
}) => {
console.log(url);
return url.pathname.startsWith("/diffle-lang/dictionary");
}, new workbox.NetworkFirst({
"cacheName": "api-cache",
plugins: [new workbox.CacheableResponsePlugin({
statuses: [0, 200]
})]
}), 'GET');

}));
Loading