Giter Club home page Giter Club logo

combohandler's People

Contributors

elementstorm avatar ericf avatar evocateur avatar kara-ryli avatar natecavanaugh avatar rgrove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

combohandler's Issues

Will this be replaced by YLS/RLS?

I wonder if this module will be replaced by YLS/RLS in the future?

I need a custom combo handler for serving my private modules. Is this the only current solution?

custom combo url template (a la stockpile)

YUI-Stockpile supports a custom template to build the combo url thru the loader that does not rely on the querystring (few reasons behind that [1]). E.g:

comboBase: "/combo~",
comboSep:  "~"

I see few options here:

  • expose parseQuery routine so it can be hacked
  • provide some basic configurations to specify comboSep and comboBase, and use those to parse the url

[1] http://www.yuiblog.com/blog/2012/11/06/managing-your-javascript-modules-with-yui-3-stockpile-2/

CSS url rewriting is broken (on windows)

The CSS url rewrite does not seem to work.
Here is my web directory:

C:\work\if\server\web>dir
 Volume in drive C has no label.
 Volume Serial Number is 82A9-DF6B

 Directory of C:\work\if\server\web

01/10/2014  06:06 AM    <DIR>          .
01/10/2014  06:06 AM    <DIR>          ..
01/02/2014  07:15 AM    <DIR>          css
01/10/2014  06:06 AM    <JUNCTION>     if [C:\work\jetty\webapps\if]
01/02/2014  07:49 AM    <DIR>          js
01/04/2014  11:58 AM    <DIR>          lib
01/10/2014  06:05 AM    <JUNCTION>     yui [C:\work\jetty\webapps\yui]
01/10/2014  06:06 AM    <JUNCTION>     yui-gallery [C:\work\jetty\webapps\yui-gallery]
               0 File(s)              0 bytes
               8 Dir(s)  35,535,917,056 bytes free

C:\work\if\server\web>

_dirname is C:\work\if\server
The project loads yui/datatable-sort/assets/skins/sam/datatable-sort.css, which contains the following line:

url(../../../../assets/skins/sam/sprite.png)

Try 1:

app.get('/combo',
  combo.combine({
    rootPath: __dirname + '/web/',
    basePath: '/web'
  }),
  combo.respond);

The combined css rewrites the aforementioned url directive to

url(C:\web\yui\assets\skins\sam\sprite.png) 

Try 2:

app.get('/combo',
  combo.combine({
    rootPath: __dirname + '/web/',
    webRoot: __dirname
  }),
  combo.respond);

Which yields exactly the same url directive:

url(C:\web\yui\assets\skins\sam\sprite.png) 

Of course, it does not work.

Relax URL validation

Strange enough YUI 3.1.1 seed makes the following request, appending an unnecessary & to the URL:

http://yui.yahooapis.com/combo?3.1.1/build/widget/assets/skins/sam/widget.css&3.1.1/build/widget/assets/skins/sam/widget-stack.css&3.1.1/build/overlay/assets/skins/sam/overlay.css&

Their service ignores the ampersand, even when it is inserted multiple times, and fulfils successfully the request.

Given this behaviour is part of Yahoo's service, would you be willing to relax the validation, perhaps by removing the following lines from combohandler.js:

        if (fileTypes.indexOf('') > -1) {
            // Most likely a malformed URL, which will just cause
            // an exception later. Short-cut to the inevitable conclusion.
            return next(new BadRequest('Truncated query parameters.'));
        }

Serving binary assets

Looks like combohandler doesn't serves binary files (images for example) properly, even though proper mime-type is provided via config. I.E. images are served broken due to pollution of original file.
Using node v0.10.18.

Update HISTORY.md for 0.3.1 release.

It's funny how unit tests and code coverage only help so much. While I noodle about a more comprehensive integration test method, with these changes combohandler will actually work in a customized capacity.

v0.3.0...master

Support YUI "shorthand" module syntax

"Classic" combo requests for YUI library follow the "module_name/module_name.js" pattern. "Shorthand" requests will omit the doubled part of the request.

Classical: combo?3.13.0/yui/yui.js
Shorthand: combo?3.13.0/yui.js

This should be achievable with some route config to enable handling missing files gracefully.

CSS Url Loading/Rewriting for YUI as well as CSS in general not working *FIX INCLUDED*

Hello,

I've ran into some serious issues with this node module regarding the handling of CSS file loading and URL rewriting; When there are skin files included within YUI, it will attempt to pull from a machine's absolute directory(at least, on Windows). Another issue is anything with a data: path in a CSS URL would also have an error as well as the absolute path to the directory itself in a CSS URL.

I am on a Windows 8.1 machine btw, if that helps at all.

I fixed these but am not 100% certain the fix will apply to Unix/Linux machines. Haven't had an opportunity to test yet.

Please see the js fiddles I've created with the files that address these issues and apply them to the node NPM directory. Otherwise these files must be replaced every time npm install is run to fix.

cssUrls.js fixes: http://jsfiddle.net/9t1t14rz/
combohandler.js fixes: http://jsfiddle.net/b4zc8m3n/

Thanks for your time and for the great extension!

-Rob

errors and cpu spin on non-existent path

comboloader has been working great for me, for use with yui2 and yui3. Compared to the yui php combo loader, it works out of the box.

However I do see one problem. When the config includes a non-existent path comboloader goes into a spin, spewing out error messages along with high cpu use. This continues until I manually kill the process.

Including the logs:

aaditya➜lib/node/combohandler(master✗)» spark2 -v                                                                                                                                                                                [13:31:01]
... starting
... detected config.js
... loading config `/usr/local/lib/node/.npm/combohandler/0.1.2/package/./config.js'
...   --roots { '/combo/static/vendor/lib/yui3': '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/vendor/lib/3.4.0x',
  '/combo/static/vendor/lib/yui2': '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/vendor/lib/2.9.0',
  '/combo/static/vendor/lib/epsilon': '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/epsilon',
  '/combo/static/vendor/lib/d1/d2/gallery': '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/vendor/lib/gallery',
  '/combo/2in3/static/vendor/lib/2in3': '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/vendor/lib/2in3' }
... detected app.js
... starting with (1) workers
... child spawned 87224

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: ENOENT, No such file or directory '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/vendor/lib/3.4.0x'
    at Object.lstatSync (fs.js:396:18)
    at Object.realpathSync (fs.js:627:23)
    at Object.combine (/usr/local/lib/node/.npm/combohandler/0.1.2/package/index.js:22:21)
    at /usr/local/lib/node/.npm/combohandler/0.1.2/package/lib/server.js:33:26
    at Object. (/usr/local/lib/node/.npm/combohandler/0.1.2/package/app.js:2:18)
    at Module._compile (module.js:407:26)
    at Object..js (module.js:413:10)
    at Module.load (module.js:339:31)
    at Function._load (module.js:298:12)
    at require (module.js:351:19)
... Child Died (87224), respawning...
... child spawned 87225

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: ENOENT, No such file or directory '/Users/aaditya/work/id/src/id/vaitarna/vaitarna/public/static/vendor/lib/3.4.0x'
    at Object.lstatSync (fs.js:396:18)
    at Object.realpathSync (fs.js:627:23)
    at Object.combine (/usr/local/lib/node/.npm/combohandler/0.1.2/package/index.js:22:21)
    at /usr/local/lib/node/.npm/combohandler/0.1.2/package/lib/server.js:33:26
    at Object. (/usr/local/lib/node/.npm/combohandler/0.1.2/package/app.js:2:18)
    at Module._compile (module.js:407:26)
    at Object..js (module.js:413:10)
    at Module.load (module.js:339:31)
    at Function._load (module.js:298:12)
    at require (module.js:351:19)
... Child Died (87225), respawning...
... child spawned 87226

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick

Support combining files across multiple roots

It would be useful to support combining files which reside in different root paths in one HTTP request.

app.get('/js', combo.combine({rootPath: [
    __dirname + '/public/js',
    __dirname + '/shared/js'
]}), function (req, res) {
    res.send(res.body, 200);
});
http://example.com/js?models/photo.js&widget/lightbox.js

One tricky aspect of this is having ambiguous file paths when a file of the same path resides in both roots.

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.