Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:23:52+00:00 2026-06-12T05:23:52+00:00

I am trying to understand the Backbone + RequireJS version of the TodoMVC. I

  • 0

I am trying to understand the Backbone + RequireJS version of the TodoMVC. I don’t understand why in the main.js file, the backbone package is not dependency?

// Require.js allows us to configure shortcut alias
require.config({
    // The shim config allows us to configure dependencies for
    // scripts that do not call define() to register a module
    shim: {
        'underscore': {
            exports: '_'
        },
        'backbone': {
            deps: [
                'underscore',
                'jquery'
            ],
            exports: 'Backbone'
        }
    },
    paths: {
        jquery: 'lib/jquery/jquery.min',
        underscore: '../../../assets/lodash.min',
        backbone: 'lib/backbone/backbone',
        text: 'lib/require/text'
    }
});

require([
    'views/app',
    'routers/router' // <--views/app.js and routers/router.js are the only dependencies
], function( AppView, Workspace ) {
    // Initialize routing and start Backbone.history()
    new Workspace();
    Backbone.history.start(); // <--Here we use Backbone variable. Where do the writer tell the page about the backbone dependency??

    // Initialize the application view
    new AppView();
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:23:53+00:00Added an answer on June 12, 2026 at 5:23 am

    Backbone is exported as a global by the shim configuration so it’s not necessary to define the dependency because it’s already available in the global namespace.

    See http://requirejs.org/docs/api.html#config-shim for more details

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to understand, why my C++/Qt application creates 18 threads, while i don't create
Trying to understand something that I don't know how to describe because I don't
I don't understand the operations of Backbone.View.render() and .el. In render() I assign this.el
I'm trying to understand how Backbone.js model validation works, but I'm seeing some odd
Trying to understand this open source app on github, it has a gem file:
Good afternoon, I'm trying to optimize a source code based on Require.js and Backbone
I am implementing Backbone.js, and I am just trying to understand how the sync
I'm trying to understand how events work in Backbone. The following seems to me
Trying to understand this entry in the php manual on debug_backtrace . I don't
I am trying understand ViewModels deeper and I have read many articles and blogs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.