Code Monkey home page Code Monkey logo

Comments (4)

andrewdavey avatar andrewdavey commented on July 4, 2024

Thanks for the suggestion; this is absolutely the right place. Keep them coming! :)

The fallback script would need to be separated from the main application scripts, to avoid it getting added to a module and then included twice in the page. So having a "fallback-scripts" folder, for example, would make this feature is feasible.

I need to give the external script feature some attention in general. Since I think they should really be configured in web.config and then a page just says "I want jQuery please". Something like this perhaps:

<cassette>
  <scripts>
    <add path="jquery" cdn="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" fallback="fallback-scripts/jquery.js" />
  </scripts>
</cassette>

in page:

Assets.Scripts.Reference("jquery");

from cassette.

sfmskywalker avatar sfmskywalker commented on July 4, 2024

I would definitiely love that!
Although this also means that each CDN url will become a module on its own, which means one subfolder per CDN url which will only contain a single (fallback) file (unless I'm not seeing it correctly).

On the other hand, I would probably be using just jQuery. Never used another CDN url before :)
Even if I had 4 CDN urls, it wouldn't be bad to have a subfolders for each of them.

from cassette.

andrewdavey avatar andrewdavey commented on July 4, 2024

The fallback scripts would not be built into modules. They'll exist just in a one separate folder of scripts.

Technically each external (CDN) URL is treated as a module by Cassette already. It's just that the URL is pre-set, instead of Cassette using it's own HTTP handler URL.

from cassette.

andrewdavey avatar andrewdavey commented on July 4, 2024

http://getcassette.net/documentation/scripts/external-modules

from cassette.

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.