Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Check existing jQuery version #87

merged 1 commit into from

2 participants


Tested MiniProfiler working back to jQuery 1.4.0. Though, I don't think we want to support that far back. Its probably safe to require a minimal of whatever version MiniProfiler bundles itself, thats 1.7.x. I feel pretty confident that 1.9.x, the last 1.x version of jQuery, is going to work fine in the future. So 1.7.x to 2.x seems like a good version constraint.

I removed useExistingJquery from a few spots in the ruby code, but I'm not sure about the .net code path. It'd probably be good to ensure that any existing configuration code setting useExistingJquery doesn't explode, but is just silent.

@josh josh Ensure existing jQuery is 1.7.x < N < 2.x
Deprecates useExistingjQuery option

I also tend to aggressively upgrade our code to the latest jquery and sometimes unreleased versions. So you'll definitely see some patches from me if 1.9.x ends up having issues with MiniProfiler.

@SamSaffron SamSaffron merged commit 24f3d8f into SamSaffron:master

I wonder if we want a stub and deprecation notice so we don't break apps for the next release?


I already stubbed the ruby version, but it doesn't do any sort of verbose warning. For ruby, its pretty easy:

def use_existing_jquery=(v)
  warn "MiniProfiler.config.use_existing_jquery is deprecated"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 8, 2012
  1. @josh

    Ensure existing jQuery is 1.7.x < N < 2.x

    josh authored
    Deprecates useExistingjQuery option
This page is out of date. Refresh to see the latest.
8 Ruby/lib/mini_profiler/config.rb
@@ -14,8 +14,11 @@ def self.attributes
attr_accessor :auto_inject, :base_url_path, :pre_authorize_cb, :position,
:backtrace_remove, :backtrace_includes, :backtrace_ignores, :skip_schema_queries,
- :storage, :user_provider, :storage_instance, :storage_options, :skip_paths, :authorization_mode, :use_existing_jquery
+ :storage, :user_provider, :storage_instance, :storage_options, :skip_paths, :authorization_mode
+ # Deprecated options
+ attr_accessor :use_existing_jquery
def self.default
new.instance_eval {
@auto_inject = true # automatically inject on every html page
@@ -30,7 +33,6 @@ def self.default
@storage = MiniProfiler::MemoryStore
@user_provider ={|env|}
@authorization_mode = :allow_all
- @use_existing_jquery = false
3  Ruby/lib/mini_profiler/profiler.rb
@@ -491,11 +491,10 @@ def get_profile_script(env)
showControls = false
currentId = current.page_struct["Id"]
authorized = true
- useExistingjQuery = @config.use_existing_jquery
# TODO : cache this snippet
script ='../html/profile_handler.js', ::File.dirname(__FILE__)))
# replace the variables
- [:ids, :path, :version, :position, :showTrivial, :showChildren, :maxTracesToShow, :showControls, :currentId, :authorized, :useExistingjQuery].each do |v|
+ [:ids, :path, :version, :position, :showTrivial, :showChildren, :maxTracesToShow, :showControls, :currentId, :authorized].each do |v|
regex ="\\{#{v.to_s}\\}")
script.gsub!(regex, eval(v.to_s).to_s)
1  StackExchange.Profiling/UI/include.partial.html
@@ -16,7 +16,6 @@
- usingExistingjQuery: {useExistingjQuery},
ids: {ids},
path: '{path}',
version: '{version}',
5 StackExchange.Profiling/UI/includes.js
@@ -580,7 +580,10 @@ var MiniProfiler = (function () {
- if (options.useExistingjQuery && typeof(jQuery) === 'function') {
+ if (typeof(jQuery) == 'function') {
+ var jQueryVersion = jQuery.fn.jquery.split('.');
+ }
+ if (jQueryVersion && parseInt(jQueryVersion[0]) < 2 && parseInt(jQueryVersion[1]) >= 7) {
MiniProfiler.jQuery = $ = jQuery;
} else {
Something went wrong with that request. Please try again.