kubetail-org / loadjs

A tiny async loader / dependency manager for modern browsers (899 bytes)
MIT License
2.57k stars 149 forks source link

Announcement: New version with support for image/css urls with query arguments and anchor tags #97

Open amorey opened 4 years ago

amorey commented 4 years ago

Hi Everyone,

I just wanted to let you know that we released a new version of LoadJS (v4.0.0) that includes support for automatic detection of image/css urls with query arguments and anchor tags. Previously you had to force treat such urls using "img!" and "css!" tags:

loadjs(
  [
    'img!image.jpg?arg=val',
    'img!image.jpg#anchortag',
    'css!style.css?arg=val',
    'css!style.css#anchortag'
  ],
  function () {}
);

Now urls of this type are detected automatically:

loadjs(
  [
    'image.jpg?arg=val',
    'image.jpg#anchortag',
    'style.css?arg=val',
    'style.css#anchortag'
  ],
  function () {}
);

Although this seems like a small change, it could cause backwards compatibility issues for users using anchor tag workarounds to force treat urls as image/css files (e.g. "handler?arg=val#.css"). As a result we are treating this as a major version release.

Please try out the new feature and let me know if notice any issues.

Andres