-
-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend bundler update nov 2024 (#3091)
Co-authored-by: Panagiotis Georgakopoulos <[email protected]>
- Loading branch information
Showing
17 changed files
with
2,510 additions
and
10,872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"..." | ||
], | ||
"reporters": [ | ||
"...", | ||
"...", | ||
"parcel-reporter-bundle-manifest" | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
// @ts-ignore | ||
import vmsg from "https://cdn.jsdelivr.net/npm/[email protected]/vmsg.js" | ||
import vmsg from "https://cdn.jsdelivr.net/npm/[email protected]/vmsg.js" // when modifying, also modify the version number in all other files. | ||
import { get_included_external_source } from "./external_source.js" | ||
|
||
export const create_recorder = async () => { | ||
const recorder = new vmsg.Recorder({ | ||
wasmURL: new URL("https://unpkg.com/[email protected]/vmsg.wasm", import.meta.url), | ||
}) | ||
const create_recorder_mp3 = async () => { | ||
const wasmURL = get_included_external_source("vmsg-wasm")?.href | ||
|
||
if (!wasmURL) throw new Error("wasmURL not found") | ||
|
||
const recorder = new vmsg.Recorder({ wasmURL }) | ||
|
||
return { | ||
start: async () => { | ||
|
@@ -20,8 +23,18 @@ export const create_recorder = async () => { | |
} | ||
} | ||
|
||
export const create_recorder = () => { | ||
try { | ||
return create_recorder_mp3() | ||
} catch (e) { | ||
console.error("Failed to create mp3 recorder", e) | ||
} | ||
|
||
return create_recorder_native() | ||
} | ||
|
||
// really nice but it can only record to audio/ogg or sometihng, nothing that works across all browsers | ||
export const create_recorder_native = async () => { | ||
const create_recorder_native = async () => { | ||
const stream = await navigator.mediaDevices.getUserMedia({ audio: true }) | ||
|
||
let chunks = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import "https://cdn.jsdelivr.net/npm/[email protected]/index.js" | ||
import { get_included_external_source } from "./external_source.js" | ||
|
||
let setup_done = false | ||
|
||
|
@@ -75,14 +76,20 @@ export const setup_mathjax = () => { | |
requestIdleCallback( | ||
() => { | ||
console.log("Loading mathjax!!") | ||
const script = document.head.querySelector("#MathJax-script") | ||
script?.addEventListener("load", () => { | ||
const src = get_included_external_source("MathJax-script") | ||
if (!src) throw new Error("Could not find mathjax source") | ||
|
||
const script = document.createElement("script") | ||
script.addEventListener("load", () => { | ||
console.log("MathJax loaded!") | ||
if (window["MathJax"]?.version !== "3.2.2") { | ||
twowasloaded() | ||
} | ||
}) | ||
script.setAttribute("src", script.getAttribute("not-the-src-yet")) | ||
script.crossOrigin = src.crossOrigin | ||
script.integrity = src.integrity | ||
script.src = src.href | ||
document.head.append(script) | ||
}, | ||
{ timeout: 2000 } | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Get a `<link rel="pluto-external-source">` element from editor.html. | ||
* @param {String} id | ||
* @returns {HTMLLinkElement?} | ||
*/ | ||
export const get_included_external_source = (id) => document.head.querySelector(`link[rel='pluto-external-source'][id='${id}']`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,12 @@ import { useDebouncedTruth } from "./RunArea.js" | |
import { time_estimate, usePackageTimingData } from "../common/InstallTimeEstimate.js" | ||
import { pretty_long_time } from "./EditOrRunButton.js" | ||
import { useEventListener } from "../common/useEventListener.js" | ||
import { get_included_external_source } from "../common/external_source.js" | ||
|
||
// This funny thing is a way to tell parcel to bundle these files.. | ||
// Eventually I'll write a plugin that is able to parse html`...`, but this is it for now. | ||
// https://parceljs.org/languages/javascript/#url-dependencies | ||
export const arrow_up_circle_icon = new URL("https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/arrow-up-circle-outline.svg", import.meta.url) | ||
export const document_text_icon = new URL("https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/document-text-outline.svg", import.meta.url) | ||
export const help_circle_icon = new URL("https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/help-circle-outline.svg", import.meta.url) | ||
export const open_icon = new URL("https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/open-outline.svg", import.meta.url) | ||
export const arrow_up_circle_icon = get_included_external_source("arrow_up_circle_icon")?.href | ||
export const document_text_icon = get_included_external_source("document_text_icon")?.href | ||
export const help_circle_icon = get_included_external_source("help_circle_icon")?.href | ||
export const open_icon = get_included_external_source("open_icon")?.href | ||
|
||
/** | ||
* @typedef PkgPopupDetails | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@charset "UTF-8"; | ||
|
||
@import url("https://cdn.jsdelivr.net/npm/[email protected]/dist/dialog-polyfill.css"); | ||
|
||
/* @import url("https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,500,700&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext"); */ | ||
|
@@ -3765,9 +3767,9 @@ pluto-cell.hooked_up pluto-output { | |
} | ||
|
||
.markdown-code-block-button::before { | ||
background-image: url("https://unpkg.com/ionicons@7.1.0/dist/svg/copy-outline.svg"); | ||
background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/copy-outline.svg"); | ||
} | ||
|
||
.markdown-code-block-copied-code-button::before { | ||
background-image: url("https://unpkg.com/ionicons@7.1.0/dist/svg/checkmark-outline.svg"); | ||
background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/checkmark-outline.svg"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ | |
<link rel="icon" type="image/png" sizes="16x16" href="./img/favicon-16x16.png" /> | ||
<link rel="icon" type="image/png" sizes="32x32" href="./img/favicon-32x32.png" /> | ||
<link rel="icon" type="image/png" sizes="96x96" href="./img/favicon-96x96.png" /> | ||
<link rel="pluto-logo-big" href="./img/logo.svg" /> | ||
<link rel="pluto-logo-small" href="./img/favicon_unsaturated.svg" /> | ||
<link rel="pluto-external-source" id="pluto-logo-big" href="./img/logo.svg" /> | ||
<link rel="pluto-external-source" id="pluto-logo-small" href="./img/favicon_unsaturated.svg" /> | ||
|
||
<script defer> | ||
console.log( | ||
|
@@ -28,6 +28,12 @@ | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/js/iframeResizer.min.js" defer></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/ansi_up.min.js" defer></script> | ||
|
||
<link rel="pluto-external-source" id="vmsg-wasm" href="https://unpkg.com/[email protected]/vmsg.wasm"> | ||
<link rel="pluto-external-source" id="arrow_up_circle_icon" href="https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/arrow-up-circle-outline.svg"> | ||
<link rel="pluto-external-source" id="document_text_icon" href="https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/document-text-outline.svg"> | ||
<link rel="pluto-external-source" id="help_circle_icon" href="https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/help-circle-outline.svg"> | ||
<link rel="pluto-external-source" id="open_icon" href="https://cdn.jsdelivr.net/gh/ionic-team/[email protected]/src/svg/open-outline.svg"> | ||
|
||
<!-- This doesn't do anything unless activated, and it makes sure parcel bundles this --> | ||
<script id="iframe-resizer-content-window-script" src="https://cdn.jsdelivr.net/npm/[email protected]/js/iframeResizer.contentWindow.min.js" crossorigin="anonymous" defer></script> | ||
|
||
|
@@ -42,7 +48,7 @@ | |
<script src="./warn_old_browsers.js"></script> | ||
|
||
<!-- This script will be enabled by JS after the notebook has initialized to prevent taking up bandwidth during the initial load. --> | ||
<script type="text/javascript" id="MathJax-script" integrity="sha384-4kE/rQ11E8xT9QgrCBTyvenkuPfQo8rXYQvJZuMgxyPOoUfpatjQPlgdv6V5yhUK" crossorigin="anonymous" not-the-src-yet="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-svg-full.js" async></script> | ||
<link rel="pluto-external-source" id="MathJax-script" href="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-svg-full.js" type="text/javascript"> | ||
|
||
<meta name="pluto-insertion-spot-preload"> | ||
</head> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@charset "UTF-8"; | ||
|
||
* { | ||
box-sizing: border-box; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@charset "UTF-8"; | ||
|
||
@import url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/400.css"); | ||
@import url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/400-italic.css"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@charset "UTF-8"; | ||
|
||
@import url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/400.css"); | ||
@import url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/400-italic.css"); | ||
@import url("https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/700.css"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@charset "UTF-8"; | ||
|
||
@import url("https://cdn.jsdelivr.net/npm/[email protected]/inter-latin.css"); | ||
|
||
:root { | ||
|