32 lines
1.3 KiB
JavaScript
32 lines
1.3 KiB
JavaScript
|
|
// Instruction Set
|
||
|
|
|
||
|
|
// The following code is the source scripts that we then minify and inline below,
|
||
|
|
// with renamed function names that we hope don't collide:
|
||
|
|
|
||
|
|
// const COMMENT_NODE = 8;
|
||
|
|
// const SUSPENSE_START_DATA = '$';
|
||
|
|
// const SUSPENSE_END_DATA = '/$';
|
||
|
|
// const SUSPENSE_PENDING_START_DATA = '$?';
|
||
|
|
// const SUSPENSE_FALLBACK_START_DATA = '$!';
|
||
|
|
// const LOADED = 'l';
|
||
|
|
// const ERRORED = 'e';
|
||
|
|
|
||
|
|
// function completeSegment(containerID, placeholderID) {
|
||
|
|
// const segmentContainer = document.getElementById(containerID);
|
||
|
|
// const placeholderNode = document.getElementById(placeholderID);
|
||
|
|
// // We always expect both nodes to exist here because, while we might
|
||
|
|
// // have navigated away from the main tree, we still expect the detached
|
||
|
|
// // tree to exist.
|
||
|
|
// segmentContainer.parentNode.removeChild(segmentContainer);
|
||
|
|
// while (segmentContainer.firstChild) {
|
||
|
|
// placeholderNode.parentNode.insertBefore(
|
||
|
|
// segmentContainer.firstChild,
|
||
|
|
// placeholderNode,
|
||
|
|
// );
|
||
|
|
// }
|
||
|
|
// placeholderNode.parentNode.removeChild(placeholderNode);
|
||
|
|
// }
|
||
|
|
|
||
|
|
// TODO: Generate this file with a build step.
|
||
|
|
export default 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}';
|