Coder Social home page Coder Social logo

Comments (6)

WebReflection avatar WebReflection commented on June 2, 2024

sorry ... what?

from document-register-element.

isaacewing avatar isaacewing commented on June 2, 2024

for example, when i include the CDNJS repo like below

<script src="//cdnjs.cloudflare.com/ajax/libs/document-register-element/0.5.3/document-register-element.js"
></script>

Could you also add a version that has the minified version of the JS file like
document-register-element.min.js"

from document-register-element.

WebReflection avatar WebReflection commented on June 2, 2024

the purpose of minification is to reduce the overall amount of bytes, right?
Why would you want 4 extra bytes per each minified URL? That would be eventually a no-brainer for a .max version, or a .debug one, who cares if the name contains those extra 4 bytes or more.

Accordingly, you might find that the CDN document-register-element.js is the minified version while to have the one that doesn't care about minification you can use document-register-element.max.js

As summary, there is a build process with a toolchain that makes files generation a straight forward and simple one shot procedure. If the purpose of minifing is to reduce as much as possible a file size, I find it illogical to have all minified files containing those pointless extra 4 .min chars so welcome to my world where the unminified version is explicitly called .max.js and the production one doesn't need any reminder in its own name and doesn't surely need to be bigger: it's minified for a reason!

Best Regards

from document-register-element.

isaacewing avatar isaacewing commented on June 2, 2024

I suppose that's a good point and I know the file is already minified, adding the .min. to the file name just maps well with all the other libraries in the CDN as they all have the *.min.js to the file so when I write a JS script that does a batch download for dependency injection, instead of looping through an array of files to download, I have to have a one-off hook that tests specifically for your file since there is no .min version. That's why I was requesting that.

from document-register-element.

WebReflection avatar WebReflection commented on June 2, 2024

when I write a JS script that does a batch download for dependency injection

If I understand correctly, that means you are not using the CDN for what it's being created for and you most likely need a hook to this repository and update whatever download only once and only when a new release is available.

You can grab it directly from here or you can simply use npm like Google AMP is doing already.

The fact everyone else is doing it wrong doesn't usually mean who actually thought about it should do it wrong as well so I am afraid all my projects are like this and I'm here to tell everyone else they can improve instead of generating automatically dumbly named files.

Apologies for any inconvenient, but I am sure you've got my point so thanks in advance for your understanding.

from document-register-element.

WebReflection avatar WebReflection commented on June 2, 2024

the TL;DR version of this problem is: nobody needs non-minified version in production if not during debugging. That shouild be the naming exception, not the default one with a pointless .min in it.

from document-register-element.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.