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

Remove Object.append(...) from index.ejs #7707

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Remove Object.append(...) from index.ejs #7707

merged 1 commit into from
Aug 7, 2019

Conversation

adamdoyle
Copy link
Contributor

@adamdoyle adamdoyle commented Aug 7, 2019

Issue: #7706

What I did

Replaced the following EJS code in lib/core/src/server/templates/index.ejs for the sake of IE11 compatibility:

before:

<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
  <script>
    Object.assign(window, <%= JSON.stringify(globals) %>);
  </script>
<% } %>

after:

<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
  <script>
    <% for (var varName in globals) { %>
        <% if (globals[varName] != undefined) { %>
          window['<%=varName%>'] = <%= JSON.stringify(globals[varName]) %>;
        <% } %>
    <% } %>
  </script>
<% } %>

How to test

@vercel
Copy link

vercel bot commented Aug 7, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tested. @adamdoyle thanks for taking care of this! 🙇

@shilman shilman merged commit 371c78f into storybookjs:next Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants