Skip to content

Avoid document write in single script linker loading - #9814

Closed
Mivr wants to merge 1 commit into
gwtproject:mainfrom
Mivr:main
Closed

Mivr wants to merge 1 commit into
gwtproject:mainfrom
Mivr:main

Conversation

@Mivr

@Mivr Mivr commented Mar 27, 2023

Copy link
Copy Markdown

Avoid document write method in single script linker.

Fixes #9797

@Mivr

Mivr commented Apr 4, 2023

Copy link
Copy Markdown
Author

jnehlmeier or anyone from GWT, any feedback on this PR?

return (slashIndex >= 0) ? path.substring(0, slashIndex + 1) : '';
};

var thisScript = $doc.currentScript;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

According to caniuse.com currentScript is not supported by IE 11. So you can not use it for now unless a decision has been made to drop IE 11 in the next GWT release.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Are you OK to make the code try currentScript and if fails to try the old implementation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That seems reasonable to me - put an explicit note so that when IE 11 is finally truly dead we know that this can be simplified out?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you OK to make the code try currentScript and if fails to try the old implementation?

Yes that would be fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Mivr do you want to make this change so we can see about merging?

@Mivr Mivr May 19, 2023 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@niloc132 Yes, sorry for the delay I am just way too busy and warnings are not the highest priority

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep no problem, just checking in with various open PRs to see what we can land before trying to do a release. No rush, we've got other pending PRs, but this one is small enough we could ship without it if you don't get the chance to get to it.

jhickman added a commit to jhickman/gwt that referenced this pull request Aug 15, 2023
- replaces PR gwtproject#9814
 - due to currentScript not being fully supported, wrapped in conditional
- fixes issue gwtproject#9797
@niloc132

Copy link
Copy Markdown
Member

Closing in favor of #9847

@niloc132 niloc132 closed this Nov 15, 2023
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.

Replace document.write('<script ...>') with document.createElement('script')

3 participants