Skip to content

Set jsonpFunction by default - #5951

Merged
mrmckeb merged 5 commits into
react:masterfrom
sibiraj-s:set-jsonpfunction
Aug 5, 2019
Merged

Set jsonpFunction by default#5951
mrmckeb merged 5 commits into
react:masterfrom
sibiraj-s:set-jsonpfunction

Conversation

@sibiraj-s

@sibiraj-ssibiraj-s commented Dec 3, 2018

Copy link
Copy Markdown
Contributor

Hi,

jsonpFunction, is set by default to prevent conflicts within app when multiple webpack runtimes (from different compilation) are used on the same webpage.

For example, a widget built with webpack being loaded into a site which is too webpacked.

https://webpack.js.org/configuration/output/#output-jsonpfunction

@netlify

netlifyBot commented Dec 6, 2018

Copy link
Copy Markdown

Deploy preview for create-react-app ready!

Built with commit 8be8452

https://deploy-preview-5951--create-react-app.netlify.com

@ianschmitzianschmitz added this to the 2.1.4 milestone Jan 7, 2019
@ianschmitzianschmitz modified the milestones: 2.1.4, 2.1.5Feb 10, 2019
@iansuiansu modified the milestones: 2.1.6, 2.1.x, 3.xMar 6, 2019
@sibiraj-s

Copy link
Copy Markdown
ContributorAuthor

@ianschmitz any update on this.

@mrmckebmrmckeb self-assigned this Jul 24, 2019
@mrmckebmrmckeb modified the milestones: 3.x, 3.1Jul 24, 2019
@mrmckeb

Copy link
Copy Markdown
Contributor

@sibiraj-s, I'd love to help you get this through.

This seems to introduce a different issue, in two apps built in CRA would still conflict. Could we use the app name instead? It's available within the config as a variable.

@mrmckeb
mrmckeb self-requested a review July 24, 2019 17:43
@sibiraj-s

Copy link
Copy Markdown
ContributorAuthor

This seems to introduce a different issue, in two apps built in CRA would still conflict.

Yeah. I didn't think of that. Will update.

@mrmckeb

Copy link
Copy Markdown
Contributor

Thanks, let me know when that's done @sibiraj-s - I think we can land this in 3.1 if you can get it done in the next few days.

@sibiraj-s

sibiraj-s commented Jul 29, 2019

Copy link
Copy Markdown
ContributorAuthor

@mrmckeb

It's available within the config as a variable.

I searched for one. but i couldn't find any. Should I go ahead add one?

incase If i missed it. Can u point me.

@mrmckeb

Copy link
Copy Markdown
Contributor

Sorry, you're right!

Just require in the package.json as we do here: https://github.com/facebook/create-react-app/blob/47e9e2c7a07bfe60b52011cf71de5ca33bdeb6e3/packages/react-scripts/scripts/init.js#L88

Then you can use appPackage.name :)

@mrmckeb
mrmckeb merged commit 066053c into react:masterAug 5, 2019
@sibiraj-s
sibiraj-s deleted the set-jsonpfunction branch August 5, 2019 13:54
@locklockBot locked and limited conversation to collaborators Aug 10, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@sibiraj-s@mrmckeb@iansu@ianschmitz@facebook-github-bot