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 881351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:14:46+00:00 2026-05-15T12:14:46+00:00

In my web projects (Django framework) I typically have a few internally developed JavaScript

  • 0

In my web projects (Django framework) I typically have a few internally developed JavaScript files that are shared among them. These web projects are stored in separate mercurial source code repositories. Here’s the relevant directory structure:

+ static
--+ css
--+ images
--+ js
-----+ thirdparty
-----+ mycompany
--------+ shared_lib1.js
--------+ shared_lib2.js
--------+ project_only_lib.js
-----+ tests

Linking to the scripts in HTML looks like so:

<script src="/static/js/mycompany/shared_lib1.js" type="text/javascript"></script>

Currently, when I make a change (say fix a bug) in one of the shared libs and check it in, the updated code only exists in the one repository. So, for now, I manually copy the changes over to the other repositories and check it in.

This seems pretty dumb.

Is there something else I should be doing that allows me to change the JavaScript, commit it to source control, and have the changes reflected in the other web projects?

  • 1 1 Answer
  • 1 View
  • 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-05-15T12:14:46+00:00Added an answer on May 15, 2026 at 12:14 pm

    You could consider storing the shared libraries in a central repository and on a central web server (e.g. http://domain.com/shared_libs/), having a directory for each revision (or tag, or revision that is a release), and embedding the libs directly from there.

    For revision 45, you would have:

    http://domain.com/shared_libs/45/lib1.js
    http://domain.com/shared_libs/45/lib2.js
    

    for the tag (or whatever the Mercurial equivalent is…) named “0.8-beta3”, you would have

    http://domain.com/shared_libs/0.8-beta3/lib1.js
    http://domain.com/shared_libs/0.8-beta3/lib2.js
    

    etc. etc.

    The process of creating a new directory for each (meaningful) revision and exporting the right files should be comparably easy on any operating system.

    In each project, you would only have references to the central server like this:

    <script src="http://domain.com/shared_libs/45/lib1.js">
    

    that way, every in-house project can choose which version of the shared libraries to use – great in case of incompatible changes, or production releases that needs to be deployed straight away and that can’t risk using a new unknown version of the shared libraries.

    Also, the shared libraries are completely separated from the projects’ revision history this way.

    If an important update occurs in the shared library, you would have to change the references in each project (e.g. from /45/lib1.js to /52/lib2.js – but a controlled switch to the each version will be the safer way anyway in the long run, in case a new release contains bugs that break the other projects.

    Another option would be having a central repo for the shared libraries, and using whatever Mercurial’s equivalent of Subversion’s externals are to “link” to the libraries from each project, keeping up to date with frequent updates of the external.

    (I’m making the assumption here that Mercurial deals with revision numbers just as Subversion does, creating a new one on each commit – I hope that is correct.)

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

Sidebar

Ask A Question

Stats

  • Questions 449k
  • Answers 449k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to determine if the field exists before you… May 15, 2026 at 8:08 pm
  • Editorial Team
    Editorial Team added an answer The tool you really want to use is GPSBabel. If… May 15, 2026 at 8:08 pm
  • Editorial Team
    Editorial Team added an answer It makes sure that unicode strings can be compared for… May 15, 2026 at 8:08 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.