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

need to update minified file #52

Merged
merged 1 commit into from
Apr 24, 2016
Merged

Conversation

allannienhuis
Copy link
Contributor

The minified file is out of date. Angularjs2 team is using the outdated version in their shims_for_IE.js file. I stumbled across the svg issue in IE11. I'll be sending them pull request for this as well.

I minified the file using uglifyjs as follows:
uglifyjs classList.js > classList.min.js -m

Not sure what you were using to minify the file originally. :)

uglifyjs classList.js > classList.min.js -m
@eligrey
Copy link
Owner

eligrey commented Apr 24, 2016

Oh thanks for catching that. I forgot to update it.

@eligrey eligrey merged commit ab4f7dd into eligrey:master Apr 24, 2016
allannienhuis added a commit to allannienhuis/angular that referenced this pull request Apr 24, 2016
the minified version of classlist polyfill used was out of date
(eligrey/classList.js#52)

Specifically it was not testing for classlist support on svg elements,
causing ngClass directives on svg elements to fail (and I presume any
other directives with dependency on classlist as well)

I minified the latest version of the classlist polyfill, and included it
into shims_for_IE.js
allannienhuis added a commit to allannienhuis/angular that referenced this pull request Apr 24, 2016
the minified version of classlist polyfill used was out of date
(eligrey/classList.js#52)

Specifically it was not testing for classlist support on svg elements,
causing ngClass directives on svg elements to fail (and I presume any
other directives with dependency on classlist as well)

I minified the latest version of the classlist polyfill, and included it
into shims_for_IE.js
allannienhuis added a commit to allannienhuis/angular that referenced this pull request Apr 24, 2016
This commit is an update for shims_for_IE with the latest version of the
classlist polyfill.

The minified version of the classlist polyfill used was out of date
(eligrey/classList.js#52)

Specifically it was not testing for classlist support on svg elements,
causing ngClass directives on svg elements to fail (and I presume any
other directives with dependency on classlist as well)

note, the PR mentioned above has been accepted by the author.
@RoyEJohnson
Copy link

There may be a problem with the new file. We have been using classList.min.js (via rawgit) and now IE11 acts as though it has no shim.

@allannienhuis
Copy link
Contributor Author

thanks, I'll retest and comment back here.

@allannienhuis
Copy link
Contributor Author

allannienhuis commented Apr 26, 2016

Can you try this plunkr? https://plnkr.co/edit/jALLcYE3zvxYeYZ0O5Dh

I am only testing for the existence of the classList function, as I simply minified the lastest unminified code.

I get the same results in both minified and unminified version of the file. If we don't include either polyfill, the classList function does not exist on svg elements on IE11, as expected.

If the latest unminified file has other functional changes you're seeing from the older minified file then perhaps that's a separate issue :) Can you redo your own test using the unminified version from rawgit?

@RoyEJohnson
Copy link

It's the older-minified-file situation. I found it in the Issues here: #44
I'm pulling https://cdn.rawgit.com/eligrey/classList.js/e87db36a95b2381a8c3ed44582a3926185cede70/classList.min.js now.

@allannienhuis
Copy link
Contributor Author

ah, that's interesting. so failing the check doesn't simply skip the polyfill, it runs different code that patches just a couple of the classlist functions (which you need). That's not that clear if you're just looking at that initial test :)

So the work to include the polyfill for svg elements should probably be separated out, so it could be applied to svg elements only (if needed), leaving the dom element prototype intact.

and then, that second branch that patches those specific functions should be run in every case, and updated to handle svg elements as well.

@allannienhuis
Copy link
Contributor Author

@RoyEJohnson, I have a change that might resolve your issue while still applying the polyfill for SVG elements. I understand you might not care about SVG support, but would you mind trying this:
https://rawgit.com/allannienhuis/classList.js/master/classList.min.js
or https://rawgit.com/allannienhuis/classList.js/master/classList.js

This change applies the full polyfill if needed, so that svg elements get the polyfill, but also applies the partial patch to support IE that is being skipped in the latest version here (the cause of the problem you saw). If it passes your test, I'll submit PR for Eli.

I'm not really certain this will work, as the partial polyfills should not pass their tests to be applied after receiving the full polyfill, but I'm not sure exactly what failed for you to know for sure. :)

Cheers,

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