3 ms·
That approach may fit the need of a modularity but it doesn't solve the remaining issues. To me, the most important issue is to make both backend and frontend d
by diamondhead 15y ago
That approach may fit the need of a modularity but it doesn't solve the remaining issues. To me, the most important issue is to make both backend and frontend dependencies same.
I haven't documented yet but there is something I'm working on for a while, OneJS. It generates a single, stand-alone JavaScript file, not requiring coder to make any change on a CommonJS code. The built file it generates can be run at any platform that doesn't support CommonJS, such as web browsers. It means that we can use the great dependency mechanism NPM provides in our frontend apps.
For those who wonders, OneJS; https://github.com/azer/onejs https://github.com/azer/onejs
Example project; https://github.com/azer/onejs/tree/master/test/example-project https://github.com/azer/onejs/tree/master/test/example-proje...
Output of the above example project; https://gist.github.com/1286969 https://gist.github.com/1286969
A relatively larger example; https://github.com/azer/multiplayerchess.com/tree/master/frontend/lib https://github.com/azer/multiplayerchess.com/tree/master/fro...
- exogen 15y agoWell, you've got some stiff competition. :) See: http://blog.brianbeck.com/post/10667967423/node-js-require-in-the-browser http://blog.brianbeck.com/post/10667967423/node-js-require-i... Is there something that differentiates your approach? I do actually think there's room for improvement in these libraries, so I'm genuinely curious.
- diamondhead 15y agoThe basic reason behind my motivation is that I'm looking for a simple solution developed for the all javascript environments with no commonjs support, not only web browsers. Besides of it, it's better to have same dependencies in both backend and frontend, taking advantage of using NPM. Imagine a test script that should be run by both NodeJS and Internet Explorer 6. What is the current most low-cost way to do it?