Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to newer jquery version #166

Closed
jeffwidman opened this issue Mar 28, 2022 · 0 comments
Closed

Upgrade to newer jquery version #166

jeffwidman opened this issue Mar 28, 2022 · 0 comments

Comments

@jeffwidman
Copy link
Member

We're currently shipping v1.5: https://github.com/flask-debugtoolbar/flask-debugtoolbar/blob/e954cd9faeabf56197041d7f3fe13e488375899f/flask_debugtoolbar/static/js/jquery.js#L2

Latest is v3.6... Probably about time to upgrade.

Note that this tablesorter may need updating at the same time for compatibility reasons: https://github.com/flask-debugtoolbar/flask-debugtoolbar/blob/e954cd9faeabf56197041d7f3fe13e488375899f/flask_debugtoolbar/static/js/jquery.tablesorter.js#L3-L5

jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
allows us to in-turn update to a newer version of `jquery`. Possibly our
existing plugin would work with newer `jquery`, but I didn't want to
spend the time to find out... plus this maintained plugin will likely
work better when `jquery` finally goes `4.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to :pointup: repo now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`.

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
allows us to in-turn update to a newer version of `jquery`. Possibly our
existing plugin would work with newer `jquery`, but I didn't want to
spend the time to find out... plus this maintained plugin will likely
work better when `jquery` finally goes `4.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`.

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
allows us to in-turn update to a newer version of `jquery`. Possibly our
existing plugin would work with newer `jquery`, but I didn't want to
spend the time to find out... plus this maintained plugin will likely
work better when `jquery` finally goes `4.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`.

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

There may be additional testing that is useful, but I'm pretty ignorang
on Javascript. If anyone else notices problems, feel free to submit a
follow-on PR.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
allows us to in-turn update to a newer version of `jquery`. Possibly our
existing plugin would work with newer `jquery`, but I didn't want to
spend the time to find out... plus this maintained plugin will likely
work better when `jquery` finally goes `4.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`.

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical.

There may be additional testing that is useful, but I'm pretty ignorang
on Javascript. If anyone else notices problems, feel free to submit a
follow-on PR.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
unblocks upgrading to `jquery` >= `1.9.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`:
     > Works with jQuery 1.9+ (`$.browser.msie` was removed; needed in the original version)

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical.

There may be additional testing that is useful, but I'm pretty ignorang
on Javascript. If anyone else notices problems, feel free to submit a
follow-on PR.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
unblocks upgrading to `jquery` >= `1.9.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`:
     > Works with jQuery 1.9+ (`$.browser.msie` was removed; needed in the original version)

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical. There may be additional warnings/errors that I don't see in
the browser, but I'm pretty ignorang on Javascript.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
unblocks upgrading to `jquery` >= `1.9.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`:
     > Works with jQuery 1.9+ (`$.browser.msie` was removed; needed in the original version)

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Ths is a follow-on PR to
#241 in order to
fix the deprecation warnings:
* `bind()` replaced by `on()`
* `click(handler)` replaced by `on('click', handler)`

Three deprecation warnings remain, but they are caused by the
`jquery.tablesorter.js` plugin, so need to be handled upstream.

Related:
* Mottie/tablesorter#1786
* #166
jeffwidman added a commit that referenced this issue Apr 11, 2024
Ths is a follow-on PR to
#241 in order to
fix the deprecation warnings:
* `bind()` replaced by `on()`
* `click(handler)` replaced by `on('click', handler)`

Three deprecation warnings remain, but they are caused by the
`jquery.tablesorter.js` plugin, so need to be handled upstream:
* Mottie/tablesorter#1787
* Mottie/tablesorter#1786

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 12, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
unblocks upgrading to `jquery` >= `1.9.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`:
     > Works with jQuery 1.9+ (`$.browser.msie` was removed; needed in the original version)

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 12, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
unblocks upgrading to `jquery` >= `1.9.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`:
     > Works with jQuery 1.9+ (`$.browser.msie` was removed; needed in the original version)

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 13, 2024
Update to the latest `v2.31.3` version of this `jquery` plugin, which
unblocks upgrading to `jquery` >= `1.9.x`.

Using a fork because:

1. The original repo hasn't been updated in seven years: https://github.com/christianbach/tablesorter
2. The most recent committer to the original repo ☝️  now maintains the fork.
3. The fork was updated just a few months ago.
4. The fork supports the latest versions of `jquery`:
     > Works with jQuery 1.9+ (`$.browser.msie` was removed; needed in the original version)

As far as I can tell, no other changes are needed.

This is a straight copy/paste of the non-minized code from: https://github.com/Mottie/tablesorter

I used non-minimized for simplicity, since this is a dev-only tool, the
perf impacts of minimization don't really matter.

I tested this manually by:

```shell
$ cd flask-debugtoolbar/test
$ flask --app basic_app run --debug
```

Then loading `http://127.0.0.1:5000/` in a recent version of Chrome and
finding a FDBT panel that uses the sorter. In this case, the SQLAlchemy
panel. I visually compared behavior pre/past upgrade and it appeared
identical.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 13, 2024
This will allow us to migrate to the latest version of jquery 1.x series.

After we're on 1.9.x we can upgrade to the 3.x series.

I bumped this, and then checked the developer console while clicking
through the various panels offered in FDBT... Everything worked as
expected and I got zero warnings from `jquery-migrate`. So I think it's
safe to pull this in.

This is a pre-requesite to upgrading to the latest version of `jquery`,
as per their docs we have to first bump to `1.9+`, then bump the version
of `jquery-migrate`, then can bump to latest `jquery` version.

While I could do this in a single PR, I thought simpler to do it as a
series of PRs for easier reversion if we later run into problems.

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 13, 2024
Bump to the latest versions of `jquery` and `jquery-migrate`.

I popped open the browser console and I see five deprecation warnings, but 3 out of the 5 are triggered by `jquery.tablesorter.js` which we vendor, so nothing we can do there.

The other two we should address, but we can do so in a follow-on PR as they are merely deprecations at this point, not fatal errors.

So getting onto the `3.x` series, even with deprecation warnings, is a nice step forward.

Previously we shipped the minified version of `jquery`, and we could
continue to do so, but given this is a dev tool and we still have
warnings we need to fix, I opted for the non-minified version for now.

Additionally, they offer a `slim` varient that is stripped down... we
could probably use that too, but I didn't take the time to investigate.

Fix: #166
jeffwidman added a commit that referenced this issue Apr 13, 2024
Ths is a follow-on PR to
#241 in order to
fix the deprecation warnings:
* `bind()` replaced by `on()`
* `click(handler)` replaced by `on('click', handler)`

Three deprecation warnings remain, but they are caused by the
`jquery.tablesorter.js` plugin, so need to be handled upstream:
* Mottie/tablesorter#1787
* Mottie/tablesorter#1786

Related:
* #166
jeffwidman added a commit that referenced this issue Apr 13, 2024
Ths is a follow-on PR to
#241 in order to fix the deprecation warnings:
* `bind()` replaced by `on()`
* `click(handler)` replaced by `on('click', handler)`

Three deprecation warnings remain, but they are caused by the `jquery.tablesorter.js` plugin, so need to be handled upstream:
* Mottie/tablesorter#1787
* Mottie/tablesorter#1786

Related:
* #166
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant