Skip to content

Refs #17201: Use Tether as a non-window global variable, last try - #20745

Closed
karolyi wants to merge 4 commits into
twbs:v4-devfrom
karolyi:v4-dev
Closed

karolyi wants to merge 4 commits into
twbs:v4-devfrom
karolyi:v4-dev

Conversation

@karolyi

@karolyi karolyi commented Sep 18, 2016

Copy link
Copy Markdown

No description provided.

@karolyi

karolyi commented Sep 18, 2016

Copy link
Copy Markdown
Author

this could be a temporary fix until you get the ES6 imports right.

@karolyi

karolyi commented Sep 20, 2016

Copy link
Copy Markdown
Author

bump

@karolyi

karolyi commented Sep 20, 2016

Copy link
Copy Markdown
Author

manually ref-ing #17201

@karolyi

karolyi commented Oct 7, 2016

Copy link
Copy Markdown
Author

bump

@bardiharborow

Copy link
Copy Markdown
Contributor

Please explain the Webpack workaround and why you need the try-catch block instead of const _Tether = Tether || window.Tether.

@karolyi

karolyi commented Oct 20, 2016

Copy link
Copy Markdown
Author

if you use x = bla || window.bla you'll get a ReferenceError in browsers when the variable doesn't exist in window. hence the try-catch

the webpack workaround:
https://github.com/karolyi/forum-django/blob/development/frontend/webpack/config.base.js#L64-L71

@mdo mdo added js JavaScript or TypeScript sources and plugins v4 v4, the frozen docs on gh-pages labels Nov 28, 2016
@karolyi

karolyi commented Dec 11, 2016

Copy link
Copy Markdown
Author

bump

@bardiharborow

Copy link
Copy Markdown
Contributor

@karolyi why would const _Tether = typeof Tether === "undefined" ? window.Tether : Tether; not work? And could you inline that into the function call so that we don't pollute the global namespace, i.e. })(jQuery, typeof Tether === "undefined" ? window.Tether : Tether).

@mdo mdo added the awaiting-reply Waiting on the author; an issue closes after 14 days without reply label Dec 21, 2016
@bardiharborow

Copy link
Copy Markdown
Contributor

Closing under the assumption that #19541 fixes this. Ping me if there are any further problems.

@Johann-S

Copy link
Copy Markdown
Member

You can close issue @bardiharborow 😲 well done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-reply Waiting on the author; an issue closes after 14 days without reply js JavaScript or TypeScript sources and plugins v4 v4, the frozen docs on gh-pages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants