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

feat: add crossOriginLoading option support #313

Merged
merged 2 commits into from
Nov 26, 2018

Conversation

chikara-chan
Copy link
Contributor

@chikara-chan chikara-chan commented Nov 21, 2018

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

#312

Reference code. We could reuse Webpack output options.

Breaking Changes

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented Nov 21, 2018

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@ooflorent ooflorent left a comment

Choose a reason for hiding this comment

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

I like the idea on reusing crossOriginLoading option but I don't like the way it is integrated in the runtime code.

In my opinion it would be better to do it like webpack.

  • if crossOriginLoading is truthy, adds the crossOrigin attribute
  • remove the if guard

In webpack, the runtime generation is different but you can look at the implementation here: https://github.com/webpack/webpack/blob/614a6fc0109a702ee64ca0b0982a0d638b1b6ca1/lib/web/JsonpMainTemplate.runtime.js#L19

@sokra
Copy link
Member

sokra commented Nov 22, 2018

@ooflorent In webpack it's similar. Also guarded by an if. It makes sure that cookies are send when requesting same-origin.

https://github.com/webpack/webpack/blob/614a6fc0109a702ee64ca0b0982a0d638b1b6ca1/lib/web/JsonpMainTemplatePlugin.js#L163-L171

see also webpack/webpack#7017

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Good work, can we add test? Maybe manual

@chikara-chan chikara-chan force-pushed the master branch 2 times, most recently from 42fd988 to 273e2a8 Compare November 25, 2018 12:13
@alexander-akait
Copy link
Member

Please accept CLA

@chikara-chan
Copy link
Contributor Author

@evilebottnawi done

@alexander-akait
Copy link
Member

@chikara-chan something wrong, looks you have difference emails in commits and in CLA

@chikara-chan
Copy link
Contributor Author

@evilebottnawi Sign the CLA with the same email in success!

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.

5 participants