eta icon indicating copy to clipboard operation
eta copied to clipboard

CDN version should be included in `https://github.com/eta-dev/eta/releases`

Open patarapolw opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe.

I find absolutely no way to use Eta in Vite, other than

cp -r ./node_modules/eta/dist/browser ./public/vendor/eta
rm -r ./public/vendor/eta/*.dev.*
declare global {
  interface Window {
    Eta: typeof import('eta')
  }
}

const script = document.createElement('script')
script.src = '/vendor/eta/eta.min.js'
document.body.append(script)

const Eta = window.Eta

export default Eta

And vite.config.js

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    rollupOptions: {
      external: /^\/vendor\//,
    },
  },
})

I also notice that eta.min.js does not exist anywhere in Github, only in NPM and various CDN's.

Describe the solution you'd like

  1. Deploy eta.min.js and eta.min.js.map to https://github.com/eta-dev/eta/releases
  2. Solve https://github.com/eta-dev/eta/issues/122

Additional context

https://eta.js.org/docs/learn/install should include Browser (non CDN).

patarapolw avatar Jun 15 '21 09:06 patarapolw

@patarapolw Sorry for the bad question, but why is it necessary for the CDN build to be included in the Github release? I'm a bit wary of adding it there because I'd rather only keep the source code in the Github releases

shadowtime2000 avatar Aug 24 '21 22:08 shadowtime2000

To facilitate ones who doesn't use NPM at all.

Same reasons as using Github Action to build on Github, and upload to binaries to release page (tags only).

patarapolw avatar Aug 25 '21 06:08 patarapolw

It is incomprehensible to me why there is no package in the releases that I can download and upload its content to my website.

bato3 avatar Oct 20 '21 12:10 bato3

Pardon me if I am wrong, but can't you just go to UNPKG and copy it into a file and use it like that?

shadowtime2000 avatar Oct 21 '21 03:10 shadowtime2000

wget is a possible way.

It is probably better to host it yourself, rather than hotlinking from CDN.

patarapolw avatar Oct 22 '21 12:10 patarapolw

For JavaScript packages, the standard is to host on the NPM registry. Downloads can be downloaded from there, from unpkg, or from jsDelivr.

I think that it's not necessary to distribute the CDN files ourselves, and would just add additional complexity to the build process.

bgub avatar May 06 '23 20:05 bgub