Skip to content

Move history panel specific JavaScript to its own file #1350

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

Merged
merged 1 commit into from
Oct 2, 2020
Merged

Move history panel specific JavaScript to its own file #1350

merged 1 commit into from
Oct 2, 2020

Conversation

jdufresne
Copy link
Contributor

Like the timer panel, the JavaScript that only applies to the history
panel should be contained within its own JavaScript module. This avoids
loading the history event handler unnecessarily.

The utility functions $$ and ajax have been moved to a utils.js es6
module so they can be imported by the main toolbar.js file as well as in
panel specific scripts.

The new utils.js module also helps move Django Debug Toolbar's
JavaScript files to a more modularized approached.

@matthiask
Copy link
Member

According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import the support for importing statically should be good enough for this.

It has at times been useful to add a few polyfills and run the odd test with the debug toolbar in Internet Explorer. Are we sure we want to leave IE behind for good, in debugging tools? I'm somewhere between an enthusiastic "of course" and a wary "will debugging be even worse in the future?" right now.

@jdufresne
Copy link
Contributor Author

IE is nearing end of life, so I think so. But I'm just one user, others may have a different perspective or needs. In the projects I work on, I have dropped IE support, but I know not everyone has that luxury. It will be nice to continue to evolve the JavaScript as the community supports new features, especially real module support. Users needing to support IE can continue to use an older version of Debug Toolbar as well.

But if it not time yet, no big deal.

@tim-schilling
Copy link
Member

The older version of the toolbar may not support all versions of Django so that might not always be an option. And I don't know if we have the maintaining effort pool to start maintaining multiple versions of the toolbar, if there was an argument to go that route.

If Microsoft's apps end of life support for IE11 is Aug 2021, that is a fair amount of time to make some developers' lives rougher. If there's no other way to do this, then I'm fine with it, but if we can work around it to support IE a little longer, I think some poor soul working with IE may be better off.

@jdufresne
Copy link
Contributor Author

jdufresne commented Oct 2, 2020

FWIW, the Django admin doesn't support IE and has started adopting JavaScript that is not compatible with it. Just one example.

https://docs.djangoproject.com/en/dev/faq/admin/

The admin provides a fully-functional experience to the recent versions of modern, web standards compliant browsers. On desktop this means Chrome, Edge, Firefox, Opera, Safari, and others.

@tim-schilling
Copy link
Member

tim-schilling commented Oct 2, 2020 via email

@matthiask
Copy link
Member

Yeah, true. The probability that I'll personally suffer from dropping IE is very small anyway since we dropped IE support several years ago 👍

Like the timer panel, the JavaScript that only applies to the history
panel should be contained within its own JavaScript module. This avoids
loading the history event handler unnecessarily.

The utility functions $$ and ajax have been moved to a utils.js es6
module so they can be imported by the main toolbar.js file as well as in
panel specific scripts.

The new utils.js module also helps move Django Debug Toolbar's
JavaScript files to a more modularized approached.
@matthiask matthiask merged commit e085f00 into django-commons:master Oct 2, 2020
@jdufresne jdufresne deleted the history-js branch October 2, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants