diff --git a/README.md b/README.md index 37daa12..3892497 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# [bundle](https://bundle.js.org) +# [bundle](https://bundlejs.org) + +> ✨ New ✨ [bundlejs.com](https://bundlejs.com) is the new official domain for `bundlejs`. bundle - An online npm package bundle size checker | Product Hunt [![Open In Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/okikio/bundle/blob/main/README.md) @@ -8,7 +10,7 @@ I used [monaco-editor](https://github.com/microsoft/monaco-editor) for the code- This project was greatly influenced by the [hardfist/neo-tools](https://github.com/hardfist/neo-tools) and [mizchi/uniroll](https://github.com/mizchi/uniroll) projects. -**bundle** is a quick and easy way to bundle your projects, minify and see it's gzip size. It's an online tool similar to [bundlephobia](https://bundlephobia.com), but **bundle** does all the bundling locally on you browser and can treeshake and bundle multiple packages (both commonjs and esm) together, all without having to install any npm packages and with typescript support. +**bundlejs** is a quick and easy way to bundle your projects, minify and see it's gzip size. It's an online tool similar to [bundlephobia](https://bundlephobia.com), but **bundle** does all the bundling locally on you browser and can treeshake and bundle multiple packages (both commonjs and esm) together, all without having to install any npm packages and with typescript support. The project isn't perfect, and I am still working on an autocomplete, hover intellisence, better mobile support and the high memory usage of **esbuild** and **monaco** as well as some edge case packages, e.g. **monaco-editor**. @@ -18,7 +20,7 @@ If there is something I missed, a mistake, or a feature you would like added ple You can join the discussion on [github discussions](https://github.com/okikio/bundle/discussions). -> Some of bundle.js.org's latest features were inspired by [egoist/play-esbuild](https://github.com/egoist/play-esbuild) and [hyrious/esbuild-repl](https://github.com/hyrious/esbuild-repl), check them out they each use esbuild in different ways. +> Some of bundlejs.com's latest features were inspired by [egoist/play-esbuild](https://github.com/egoist/play-esbuild) and [hyrious/esbuild-repl](https://github.com/hyrious/esbuild-repl), check them out they each use esbuild in different ways. ## URL Queries & Shareable Links @@ -28,30 +30,30 @@ You can now use search queries in **bundle**, all you need to do is add this to e.g. You want `react`, `react-dom`, `vue`, and `@okikio/animate`, but only want the `Animate` and `toStr` methods exported from `@okikio/animate`. -You would add this to the url [bundle.js.org/?q=react,react-dom,vue,@okikio/animate&treeshake=[\*],[\*],[\*],[{Animate,toStr}]](https://bundle.js.org/?q=react,react-dom,vue,@okikio/animate&treeshake=[*],[*],[*],[{Animate,toStr}]) +You would add this to the url [bundlejs.com/?q=react,react-dom,vue,@okikio/animate&treeshake=[\*],[\*],[\*],[{Animate,toStr}]](https://bundlejs.com/?q=react,react-dom,vue,@okikio/animate&treeshake=[*],[*],[*],[{Animate,toStr}]) -If you only want a couple packages and don't care to treeshake, then all you need is something like this, [bundle.js.org?q=react,react-dom,vue,@okikio/animate](https://bundle.js.org/?q=react,react-dom,vue,@okikio/animate) +If you only want a couple packages and don't care to treeshake, then all you need is something like this, [bundlejs.com?q=react,react-dom,vue,@okikio/animate](https://bundlejs.com/?q=react,react-dom,vue,@okikio/animate) -There is another way to share a reproduciable bundle, the sharable link. Shareble links look like this [/?share=PTAEGEB...](https://bundle.js.org/?share=PTAEGEBsEsGMGtQCUCuA7UAzA9gJ1AC4AWApqAELoAmkJVoA1KALLRrSbR2OgDiAXtAAOQ7kICGCcQHMyAZ2j8SAKBIAPIXgKgAVFlzYAtqABEAAWzxoV7MHHtD4giRMBuIA) with the string value of the input code editor being compressed into a string and placed into the URL. +There is another way to share a reproduciable bundle, the sharable link. Shareble links look like this [/?share=PTAEGEB...](https://bundlejs.com/?share=PTAEGEBsEsGMGtQCUCuA7UAzA9gJ1AC4AWApqAELoAmkJVoA1KALLRrSbR2OgDiAXtAAOQ7kICGCcQHMyAZ2j8SAKBIAPIXgKgAVFlzYAtqABEAAWzxoV7MHHtD4giRMBuIA) with the string value of the input code editor being compressed into a string and placed into the URL. In order to create a shareble link, you click the `Share` button, it copies the share url to your clipboard, and from there you can paste where you wish. -> If you would like to bundle your code when the share URL is loaded, add `bundle` to the url, e.g. [/?bundle&q=@okikio/animate](https://bundle.js.org/?q=@okikio/animate&bundle) or [/?bundle&share=PTAEGEBs...](https://bundle.js.org/?bundle&share=PTAEGEBsEsGMGtQCUCuA7UAzA9gJ1AC4AWApqAELoAmkJVoA1KALLRrSbR2OgDiAXtAAOQ7kICGCcQHMyAZ2j8SAKBIAPIXgKgAVFlzYAtqABEAAWzxoV7MHHtD4giRMBuIA) +> If you would like to bundle your code when the share URL is loaded, add `bundle` to the url, e.g. [/?bundle&q=@okikio/animate](https://bundlejs.com/?q=@okikio/animate&bundle) or [/?bundle&share=PTAEGEBs...](https://bundlejs.com/?bundle&share=PTAEGEBsEsGMGtQCUCuA7UAzA9gJ1AC4AWApqAELoAmkJVoA1KALLRrSbR2OgDiAXtAAOQ7kICGCcQHMyAZ2j8SAKBIAPIXgKgAVFlzYAtqABEAAWzxoV7MHHtD4giRMBuIA) ## Badges You can also add bundle badges, they look like this, -[![Open Bundle](./src/assets/badge-light.svg)](https://bundle.js.org/) [![Open Bundle](./src/assets/badge-dark.svg)](https://bundle.js.org/) +[![Open Bundle](./src/assets/badge-light.svg)](https://bundlejs.com/) [![Open Bundle](./src/assets/badge-dark.svg)](https://bundlejs.com/) All you need to do is to add this to your `README.md` ```md # Light Mode Badge -[![Open Bundle](https://bundle.js.org/badge-light.svg)](https://bundle.js.org/) +[![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/) # Dark Mode Badge -[![Open Bundle](https://bundle.js.org/badge-dark.svg)](https://bundle.js.org/) +[![Open Bundle](https://bundlejs.com/badge-dark.svg)](https://bundlejs.com/) ``` You can use the [URL Queries & Shareable Links](#url-queries--shareable-links) above, to create unique bundles, when users clicks on the badge. @@ -68,5 +70,6 @@ Backers are awesome people and organizations who use, enjoy, and donate to the p --> + diff --git a/gulpfile.js b/gulpfile.js index 73a852b..c64cdea 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -384,7 +384,7 @@ task("sitemap", async () => { return stream(`${htmlFolder}/**/*.html`, { pipes: [ sitemap({ - siteUrl: "https://bundle.js.org", + siteUrl: "https://bundlejs.com", mappings: [ { pages: ["**/*"], diff --git a/package.json b/package.json index 8360ce3..c4f4feb 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "bugs": { "url": "https://github.com/okikio/bundle/issues" }, - "homepage": "https://bundle.js.org", + "homepage": "https://bundlejs.com", "dependencies": { "@amoutonbrady/lz-string": "^0.0.1", "@dprint/formatter": "^0.2.0", diff --git a/repl.ts b/repl.ts index 32202f5..5acf71d 100644 --- a/repl.ts +++ b/repl.ts @@ -19,5 +19,5 @@ function n(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n, console.log(btoa(unescape(encodeURIComponent(String.fromCharCode(...await compress(encoded))))).length); console.log(btoa(unescape(encodeURIComponent(String.fromCharCode(...await gzip(encoded))))).length); console.log(btoa(unescape(encodeURIComponent(String.fromCharCode(...await brotli(encoded, encoded.length, 11))))).length); - // console.log(decode(await compress(encode("https://bundle.js.org/?q=unpkg:@okikio/animate&config={%22compression%22:%22brotli%22,%22esbuild%22:{%22minify%22:false}}")))); + // console.log(decode(await compress(encode("https://bundlejs.com/?q=unpkg:@okikio/animate&config={%22compression%22:%22brotli%22,%22esbuild%22:{%22minify%22:false}}")))); })(); \ No newline at end of file diff --git a/src/assets/open-search.xml b/src/assets/open-search.xml index 5971890..47fe993 100644 --- a/src/assets/open-search.xml +++ b/src/assets/open-search.xml @@ -2,9 +2,9 @@ bundle bundle.js - a quick and easy way to bundle your projects, minify and see it's gzip size - https://bundle.js.org/favicon/favicon.ico + https://bundlejs.com/favicon/favicon.ico UTF-8 opensearch@test.org - - https://bundle.js.org + + https://bundlejs.com diff --git a/src/assets/robots.txt b/src/assets/robots.txt index f4edbeb..5afb6ce 100644 --- a/src/assets/robots.txt +++ b/src/assets/robots.txt @@ -1,3 +1,3 @@ -Sitemap: https://bundle.js.org/sitemap.xml +Sitemap: https://bundlejs.com/sitemap.xml User-agent: * Allow: / \ No newline at end of file diff --git a/src/css/app.scss b/src/css/app.scss index 0e5c0a6..0179fa5 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -186,15 +186,7 @@ main { #about, #faq { - @apply px-5 pt-24; - - h4 { - @apply pt-12; - } - - h4:first-of-type { - @apply pt-4; - } + @apply px-5 pt-12; p { @apply text-lg; @@ -209,10 +201,6 @@ main { @apply text-5xl font-bold; } - h2#usage { - @apply text-4xl font-bold; - } - .tab-style { // @apply text-lg; text-decoration: underline; @@ -220,10 +208,6 @@ main { text-underline-offset: 0.35rem; } - h2#faq { - @apply pl-0; - } - h4 { @apply text-2xl font-bold; } diff --git a/src/pug/about.pug b/src/pug/about.pug index b98dc56..63bd274 100644 --- a/src/pug/about.pug +++ b/src/pug/about.pug @@ -4,21 +4,19 @@ block pageInfo - let page = { url: "/about", - title: "About - bundle", + title: "About - bundlejs", description: "Details about how bundle was made as well, as well links, sources, and all the tools I used to make bundle." }; block content #about.container.max-w-screen-lg h2.text-center.mb-8 About - +product-hunt(loading="eager") - p - strong bundle + strong bundlejs | is a quick and easy way to bundle your projects, minify and see their gzip and brotli size. It's an online tool similar to a(href="https://bundlephobia.com" target="_blank" rel="noopener") bundlephobia | , but - strong bundle + strong bundlejs | does all the bundling locally on you browser and can treeshake and bundle multiple packages (both commonjs and esm) together, all without having to install any npm packages and with typescript support. br br @@ -29,14 +27,16 @@ block content | for the code-editor, a(href="https://github.com/evanw/esbuild" target="_blank" rel="noopener") esbuild | as bundler and treeshaker respectively, - a(href="https://github.com/hazae41/denoflate/tree/master" target="_blank" rel="noopener") denoflate + a(href="https://github.com/hazae41/denoflate" target="_blank" rel="noopener") denoflate | as a wasm port of gzip, - a(href="https://github.com/denosaurs/deno_brotli/tree/master" target="_blank" rel="noopener") deno_brotli + a(href="https://github.com/denosaurs/deno_brotli" target="_blank" rel="noopener") deno_brotli | as a wasm port of brotli, a(href="https://github.com/denosaurs/deno_lz4" target="_blank" rel="noopener") deno_lz4 | as a wasm port of lz4, a(href="https://github.com/sindresorhus/pretty-bytes" target="_blank" rel="noopener") pretty-bytes - | to convert the compressed size to human readable values, and + | to convert the compressed size to human readable values, + a(href="https://github.com/mikecao/umami" target="_blank" rel="noopener") umami + | for private, publicly available analytics and general usage stats all without cookies, and a(href="https://github.com/mlomb/countapi-js" target="_blank" rel="noopener") countapi-js | to keep track of the number of page visits, in a private and secure way. br @@ -47,12 +47,12 @@ block content | and a(href="https://github.com/mizchi" target="_blank" rel="noopener") @mizchi's a(href="https://github.com/mizchi/uniroll" target="_blank" rel="noopener") uniroll - | project. - br - :markdown-it(linkify langPrefix='language-') - > Some of bundle.js.org's latest features were inspired by [egoist/play-esbuild](https://github.com/egoist/play-esbuild) and [hyrious/esbuild-repl](https://github.com/hyrious/esbuild-repl), check them out they each use esbuild in different ways. + | project. br br + :markdown-it(linkify langPrefix='language-') + > Some of bundlejs's latest features were inspired by [egoist/play-esbuild](https://github.com/egoist/play-esbuild) and [hyrious/esbuild-repl](https://github.com/hyrious/esbuild-repl), check them out they each use esbuild in different ways. + span= "The project isn't perfect, I am still working on an autocomplete, better mobile support and the high memory usage of " strong esbuild span= " and " @@ -76,3 +76,6 @@ block content | You can join the discussion on a(href="https://github.com/okikio/bundle/discussions" target="_blank" rel="noopener") github discussions | . + br + br + +product-hunt(loading="lazy") diff --git a/src/pug/components/navbar.pug b/src/pug/components/navbar.pug index b703232..4ccd55b 100644 --- a/src/pug/components/navbar.pug +++ b/src/pug/components/navbar.pug @@ -36,7 +36,7 @@ mixin navbar .container .navbar-frame a.navbar-logo(href='/').flex.gap-2 - img(src="/favicon/favicon.svg", alt="The bundle.js.org logo" width="24" height="28" loading="eager" importance="medium") + img(src="/favicon/favicon.svg", alt="The bundlejs.com logo" width="24" height="28" loading="eager" importance="medium") span(aria-hidden="true") bundle .mobile.pr-4 .flex.gap-1.w-full.space-x-0.items-center diff --git a/src/pug/components/product-hunt.pug b/src/pug/components/product-hunt.pug index 3178c07..4accbbf 100644 --- a/src/pug/components/product-hunt.pug +++ b/src/pug/components/product-hunt.pug @@ -4,4 +4,4 @@ mixin product-hunt figure(width='250', height='54') img.dark(src='https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=300568&theme=dark' alt="Product hunt badge" loading="lazy" importance="high" width='250', height='54')&attributes(attributes) img(src='https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=300568&theme=light' alt="Product hunt badge" loading="lazy" importance="high" width='250', height='54')&attributes(attributes) - figcaption A link to bundle.js.org's Product Hunt page; a small public display of what bundle.js.org is all about \ No newline at end of file + figcaption A link to bundlejs.com's Product Hunt page; a small public display of what bundlejs.com is all about \ No newline at end of file diff --git a/src/pug/components/seo.pug b/src/pug/components/seo.pug index 5e8d596..84c7140 100644 --- a/src/pug/components/seo.pug +++ b/src/pug/components/seo.pug @@ -60,7 +60,7 @@ mixin seo(page, defaults) "url":"#{defaults.websiteURL}", "sameAs":[ "https://www.producthunt.com/posts/bundle-6", - "https://bundle.js.org", + "https://bundlejs.com", "https://bundlesize.com", "https://bundlejs.com", "https://github.com/okikio/bundle", diff --git a/src/pug/faq.pug b/src/pug/faq.pug index bd7d13e..1fcbda4 100644 --- a/src/pug/faq.pug +++ b/src/pug/faq.pug @@ -4,14 +4,14 @@ block pageInfo - let page = { url: "/faq", - title: "frequently asked questions - bundle", - description: "I frequently get asked what was the point in building bundle, this is a short, quick, and simple summary of frequently asked questions and my reasons for building bundle." + title: "FAQ - bundlejs", + description: "Frequently Asked Questions. I frequently get asked what was the point in building bundlejs, this is a short, quick, and simple summary of frequently asked questions and my reasons for building bundlejs." }; block content #faq.container.max-w-screen-lg - h2.text-center.mb-8 Frequently Asked Questions - p I frequently get asked what was the point in building bundle, this is a short, quick, and simple summary of frequently asked questions and my reasons for building bundle. + h2.text-center.mb-8(aria-label="Frequently Asked Questions" title="Frequently Asked Questions") FAQ + p I frequently get asked what was the point in building bundlejs, this is a short, quick, and simple summary of frequently asked questions and my reasons for building bundlejs. br br h4.mb-2 @@ -23,11 +23,11 @@ block content There are a couple reasons for this, but the main one is that `bundlephobia` wasn't reliable enough. br h4.mb-2 What do you mean wasn't reliable enough? - p Right now #[code bundlephobia], is a bit hit or miss when it comes to treeshaking. So, I built #[strong bundle.js.org], which can treeshake bundles accurately. + p Right now #[code bundlephobia], is a bit hit or miss when it comes to treeshaking. So, I built #[strong bundlejs.com], which can treeshake bundles accurately. br br :markdown-it(linkify langPrefix='language-') - For example, try treeshaking the `Event` class from `@okikio/emitter` using [bundlephobia](https://bundlephobia.com/package/@okikio/emitter) and try treeshaking the `Event` class using [bundle.js.org](/?bundle&q=@okikio/emitter&treeshake=Event). + For example, try treeshaking the `Event` class from `@okikio/emitter` using [bundlephobia](https://bundlephobia.com/package/@okikio/emitter) and try treeshaking the `Event` class using [bundlejs.com](/?bundle&q=@okikio/emitter&treeshake=Event). ```ts export { Event } from "@okikio/emitter"; ``` @@ -50,7 +50,7 @@ block content this just isn't very useful for debugging. br :markdown-it(linkify langPrefix='language-') - On the other hand, since, `bundle.js.org` runs locally right on your computer, when an error occurs it logs the exact error you would see when using [esbuild](https://esbuild.github.io/) or other bundlers in your build process, making it much easier to know exactly what is wrong with your js bundle. + On the other hand, since, `bundlejs.com` runs locally right on your computer, when an error occurs it logs the exact error you would see when using [esbuild](https://esbuild.github.io/) or other bundlers in your build process, making it much easier to know exactly what is wrong with your js bundle. br h4.mb-2 Wait, locally as in no external servers? p @@ -61,4 +61,4 @@ block content h4.mb-2 Can it bundle multiple packages and treeshake them? p :markdown-it(linkify langPrefix='language-') - Yes. `bundle.js.org` can treeshake all packages, and it can do so accurately. + Yes. `bundlejs.com` can treeshake all packages, and it can do so accurately. diff --git a/src/pug/index.pug b/src/pug/index.pug index 25d64d1..c220191 100644 --- a/src/pug/index.pug +++ b/src/pug/index.pug @@ -9,6 +9,7 @@ block content .container header + blockquote ✨ New ✨ #[a(href="https://bundlejs.com") bundlejs.com] is the new official domain for #[code bundlejs]. h1 bundle p | a quick npm package size checker @@ -131,7 +132,7 @@ block content summary h4 Usage div.content.py-4 - p When bundling packages that also export CSS and other external files, #[strong bundle.js.org] now checks the gzip/brotli size of these external files, even though it won't output any code. Keep this in mind this isn't a bug, however, if it causes confusion I am willing to change this behaviour. + p When bundling packages that also export CSS and other external files, #[strong bundlejs.com] now checks the gzip/brotli size of these external files, even though it won't output any code. Keep this in mind this isn't a bug, however, if it causes confusion I am willing to change this behaviour. br p Treeshaking is available, but not all CDNs support access to each packages package.json so there might be slight package version conflicts. The only verified CDN with access to the package.json is #[a(href="https://unpkg.com" target="_blank" rel="noopener") unpkg.com]. br @@ -225,9 +226,9 @@ block content br br div.space-x-2 - a(href="https://bundle.js.org/" class="inline-block") + a(href="https://bundlejs.com/" class="inline-block") img(src="/badge-light.svg", alt="Open Bundle" loading="lazy" width="150" height="40") - a(href="https://bundle.js.org/" class="inline-block") + a(href="https://bundlejs.com/" class="inline-block") img(src="/badge-dark.svg", alt="Open Bundle" loading="lazy" width="150" height="40") br | All you need to do is to add this to your #[code README.md] @@ -235,13 +236,13 @@ block content :markdown-it(linkify langPrefix='language-') ```md # Light Mode Badge - [![Open Bundle](https://bundle.js.org/badge-light.svg)](https://bundle.js.org/) + [![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/) # Dark Mode Badge - [![Open Bundle](https://bundle.js.org/badge-dark.svg)](https://bundle.js.org/) + [![Open Bundle](https://bundlejs.com/badge-dark.svg)](https://bundlejs.com/) ``` br - | You can use the #[a(href="#url-queries--shareable-links") URL Queries & Shareable Links] above, to create unique bundles, when users clicks on the badge. + | You can use the #[a(href="#sharing") Sharing] section above, to create unique bundles, when users clicks on the badge. +divider @@ -263,7 +264,7 @@ block content span @daniguardio_la li And more, etc... - script(src=`https://opencollective.com/bundle/banner.js` async) + //- script(src=`https://opencollective.com/bundle/banner.js` async fetchpriority="low") +divider @@ -286,11 +287,13 @@ block content data-lang="en" data-loading="lazy" crossorigin="anonymous" - async + defer + fetchpriority="low" ) //- br br + blockquote #[strong Note] You can also use #[a(href="https://bundlesize.com") bundlesize.com] to access #[code bundlejs]. blockquote Special thanks to #[a(href="https://sheetjs.com") @sheetjs] and #[a(href="https://daniguardio.la/" ) @daniguardio_la] for donating to #[code bundle] on #[a(href="https://opencollective.com/bundle") OpenCollective]. br .text-center diff --git a/src/pug/layouts/layout.pug b/src/pug/layouts/layout.pug index 37baf93..75528cf 100644 --- a/src/pug/layouts/layout.pug +++ b/src/pug/layouts/layout.pug @@ -33,7 +33,7 @@ html.dark(lang="en") meta(name='color-scheme', content='dark light') - link(rel='search' href='https://bundle.js.org/open-search.xml' type='application/opensearchdescription+xml' title='bundle') + link(rel='search' href='https://bundlejs.com/open-search.xml' type='application/opensearchdescription+xml' title='bundle') link(rel="icon", type="image/svg+xml" href="/favicon/favicon.svg") link(rel="manifest", href="/manifest.json") @@ -53,7 +53,7 @@ html.dark(lang="en") - let defaults = { url: "/", - websiteURL: "https://bundle.js.org", + websiteURL: "https://bundlejs.com", title: "bundle - an online bundler + a npm package size checker", description: "A quick and easy way to bundle, minify, and compress (gzip and brotli) your ts, js, jsx and npm projects all online, with the bundle file size.", keywords: "bundle, rollup, esbuild, gzip, npm, brotli, deno, bundler, treeshake, bundlephobia, cdn, github, skypack, unpkg, compressed, jsx, online bundler, size, package, minify, es2020, monaco-editor, typescript" @@ -103,7 +103,7 @@ html.dark(lang="en") +footer //- script(src="https://cdn.polyfill.io/v3/polyfill.min.js?features=default,es2015,es2018,Array.prototype.includes,Promise,Intl" async fetchpriority="high") - script(async='', defer='', data-website-id='8bc0c9cc-4c05-4667-971e-6f3cf4200de5', src='https://analytics.bundlejs.com/umami.js') + script(src='https://analytics.bundlejs.com/umami.js' data-website-id='8bc0c9cc-4c05-4667-971e-6f3cf4200de5' defer) script(src='/js/main.min.js' type='module' async) block script diff --git a/src/ts/index.ts b/src/ts/index.ts index ba76b4d..42af16e 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -14,7 +14,7 @@ import { addLogs, clearLogs } from "./components/Console"; -import { hit } from "countapi-js"; +import { hit, set } from "countapi-js"; import { decode, encode } from "./util/encode-decode"; import { parseInput } from "./util/parse-query"; @@ -741,6 +741,7 @@ export const InitialRender = (shareURL: URL) => { (async () => { if (!PRODUCTION_MODE) return; try { + await set("bundle.js.org/visits", 26900); let { value } = await hit("bundle.js.org", "visits"); let visitCounterEl = document.querySelector("#visit-counter"); if (visitCounterEl) diff --git a/src/ts/main.ts b/src/ts/main.ts index 93d9ad0..cd2448c 100644 --- a/src/ts/main.ts +++ b/src/ts/main.ts @@ -64,12 +64,13 @@ try { // Fade Out Old Page out({ from }) { let fromWrapper = from.wrapper; + DetailsComponent.stop(); return animate({ target: fromWrapper, opacity: [1, 0], duration: 200, - }) + }); }, // Fade In New Page @@ -82,6 +83,7 @@ try { opacity: [0, 1], duration: 200 }); + DetailsComponent.run(); } }; diff --git a/src/ts/modules/details.ts b/src/ts/modules/details.ts index b6c83d0..8e53551 100644 --- a/src/ts/modules/details.ts +++ b/src/ts/modules/details.ts @@ -183,7 +183,16 @@ export const run = () => { detailsEls.set(el, new DetailsComponent(el)); }); } -} +}; + +export const stop = () => { + let details = Array.from(document.querySelectorAll("details")); + if (details.length > 0) { + details.forEach((el) => { + detailsEls.delete(el); + }); + } +}; export const hashChange = () => { let { hash } = document.location; diff --git a/src/ts/plugins/external.ts b/src/ts/plugins/external.ts index f2f52db..cdf4a49 100644 --- a/src/ts/plugins/external.ts +++ b/src/ts/plugins/external.ts @@ -115,7 +115,7 @@ export const EXTERNAL = (external: string[] = []): Plugin => { contents: EMPTY_EXPORT, warnings: [{ text: `${args.path} is marked as an external module and will be ignored.`, - details: `"${args.path}" is a built-in node module thus can't be bundled by https://bundle.js.org, sorry about that.` + details: `"${args.path}" is a built-in node module thus can't be bundled by https://bundlejs.com, sorry about that.` }] }; });