Bug#892227: [Pkg-javascript-devel] Bug#892227: node-backbone: dependencies fail to resolve when jQuery not installed
Quoting Ben Finney (2018-03-07 02:51:55) > On 07-Mar-2018, Jonas Smedegaard wrote: > > Quoting Ben Finney (2018-03-07 01:04:19) > > > $ cat ./source/foo.js > > > "use strict"; > > > import 'backbone'; > > > > > > So the Debian package dependencies are all satisfied, but these are > > > not sufficient for Webpack to resolve the Backbone dependencies. > > > > Backbone by design avoids dependency on jQuery. > > And yet, a very simple application that *only* requests ‘backbone’ > will fail to build with Webpack because Backbone tries to find jQuery. > > In other words: The expectation is that installing Debian packages > ‘webpack’ ands ‘node-backbone’ should allow the above application to > build with Webpack. > > So, something is wrong with the Debian Backbone, or the Debian > Webpack, or something else. I slept on it, and realized this morning¹ that you are right: This is a bug in Debian packaging of Backbone: It should recommend node-jquery. Similarly it should recommend node-underscore | node-lodash. I will make that happen. Thanks! - Jonas ¹ ...before reading your reply above, but that helps too: Your emails are in general easy to comprehend and quite often enlightening. Thanks! -- * Jonas Smedegaard - idealist & Internet-arkitekt * Tlf.: +45 40843136 Website: http://dr.jones.dk/ [x] quote me freely [ ] ask before reusing [ ] keep private signature.asc Description: signature
Bug#892227: [Pkg-javascript-devel] Bug#892227: node-backbone: dependencies fail to resolve when jQuery not installed
On 07-Mar-2018, Jonas Smedegaard wrote: > Quoting Ben Finney (2018-03-07 01:04:19) > > $ cat ./source/foo.js > > "use strict"; > > import 'backbone'; > > > > So the Debian package dependencies are all satisfied, but these are > > not sufficient for Webpack to resolve the Backbone dependencies. > > Backbone by design avoids dependency on jQuery. And yet, a very simple application that *only* requests ‘backbone’ will fail to build with Webpack because Backbone tries to find jQuery. In other words: The expectation is that installing Debian packages ‘webpack’ ands ‘node-backbone’ should allow the above application to build with Webpack. So, something is wrong with the Debian Backbone, or the Debian Webpack, or something else. -- \ “Are you pondering what I'm pondering?” “I think so, Brain, but | `\why would anyone want a depressed tongue?” —_Pinky and The | _o__) Brain_ | Ben Finney signature.asc Description: PGP signature
Bug#892227: [Pkg-javascript-devel] Bug#892227: node-backbone: dependencies fail to resolve when jQuery not installed
Quoting Ben Finney (2018-03-07 01:04:19) > Package: node-backbone > Version: 1.3.3~dfsg-3 > Severity: normal > > The dependencies for ‘node-backbone’ do not allow a Backbone > application to be built with Webpack. > > = > $ dpkg --list webpack > […] > ii webpack3.5.6-1 all Packs CommonJs/AMD modules for > the browser > > $ webpack --version > 3.5.6 > > $ cat ./webpack.config.js > "use strict"; > const path = require('path'); > module.exports = { > entry: './source/foo.js', > output: { > path: path.resolve(__dirname, 'dist'), > filename: 'app.js', > }, > resolve: { > modules: ['/usr/lib/nodejs', '.'], > }, > resolveLoader: { > modules: ['/usr/lib/nodejs'], > }, > }; > > $ cat ./source/foo.js > "use strict"; > import 'backbone'; > > $ webpack --config webpack.config.js > Hash: a9597112585b9ca5fb40 > Version: webpack 3.5.6 > Time: 209ms > AssetSize Chunks Chunk Names > app.js 129 kB 0 [emitted] main >[0] ./source/foo.js 34 bytes {0} [built] >[1] /usr/share/javascript/backbone/backbone.js 72.2 kB {0} [built] >[2] (webpack)/buildin/global.js 488 bytes {0} [built] >[3] /usr/share/javascript/underscore/underscore.js 52.9 kB {0} [built] > > ERROR in /usr/share/javascript/backbone/backbone.js > Module not found: Error: Can't resolve 'jquery' in > '/usr/share/javascript/backbone' > @ /usr/share/javascript/backbone/backbone.js 17:4-21:6 > @ ./source/foo.js > = > > So the Debian package dependencies are all satisfied, but these are > not sufficient for Webpack to resolve the Backbone dependencies. Backbone by design avoids dependency on jQuery. Applications may use jQuery via Backbone, or may choose to instead use Zepto or Lodash, and then need themselves to make sure the chosen helper is available. At http://backbonejs.org/ is listed a few projects choosing to use Backbone with Zepto instead of jQuery. - Jonas -- * Jonas Smedegaard - idealist & Internet-arkitekt * Tlf.: +45 40843136 Website: http://dr.jones.dk/ [x] quote me freely [ ] ask before reusing [ ] keep private signature.asc Description: signature