Skip to content

Auto-importing jquery creates potential race condition with external jquery import #61

@danbgoldman

Description

@danbgoldman

I ran into many odd, spurious errors when using it with a bootstrap template. Many hours of debugging later I realized this was because bootstrap uses jquery, I was using a different version, and both of these were imported before bibtex.js. Sometimes one load would complete first, other times it would complete second. The polling in checkReady cannot guarantee which one is used, and perhaps some hooks from each are used. This caused many unreproducible bugs involving tooltips, ajax, and tabs. Ensuring that the external call came first - and using the non-slim version that includes ajax - made most of these problems go away.

I appreciate the elegance of a self-contained script, but I think it hides important information from other developers!

(Also, perhaps it should be a separate issue, but I also noticed the imports of jquery and moment are missing subresource integrity attributes, which are important to avoid CDN server-side attacks. See srihash.org for more info.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions