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

Add in documentation that Node.js global vars may be kept between deployments #368

Closed
paulbatum opened this issue Jun 28, 2017 · 7 comments
Assignees

Comments

@paulbatum
Copy link
Member

From @yvele on February 24, 2017 20:20

Specially usefull information when using Webpack to drastically reduce Azure Function cold start.

I understand the global vars sharing when I tried to use babel-polyfill and got this error:

Error: only one instance of babel-polyfill is allowed

Babel polyfill is using global vars and although I was importing it only once (in my webpack.config), I constantly get this error, and I finally had to make a little wrapper around my Azure Function handle to make sure babel-polyfill is not already loaded in global vars before requiring it.

I suggest adding a global vars warning in the documentation (especially with all Node.js developers going to make a webpack bundle to reduce Azure Function cold start.

This issue is kind of related to Azure/azure-functions-host#298 (comment) and attempts to make Azure Function work with Webpack.

Copied from original issue: Azure/azure-functions-host#1234

@paulbatum paulbatum added the docs label Jun 28, 2017
@paulbatum
Copy link
Member Author

From @lindydonna on March 14, 2017 0:14

@christopheranderson @yochay Shouldn't this be moved to the Functions repo, since it's about documentation?

@paulbatum
Copy link
Member Author

From @christopheranderson on April 3, 2017 17:17

@lindydonna - yes this should be moved

@paulbatum
Copy link
Member Author

From @lindydonna on April 3, 2017 19:35

@christopheranderson Could you file a new issue in the docs repo to track this? You have more context on the doc requirement.

@ggailey777 ggailey777 changed the title Add in documentation that Node.js global vars may be keeped between deployments Add in documentation that Node.js global vars may be kept between deployments Dec 14, 2017
@nevercast
Copy link

nevercast commented Jun 6, 2018

@yvele What was your workaround for this?
Edit: I went with this in the end, should anyone else stumble here: https://gist.github.com/nevercast/e62157ccf385a9f22d1f68ec04274a5b

@ColbyTresness ColbyTresness self-assigned this Feb 15, 2019
@ColbyTresness ColbyTresness added this to the Active Questions milestone Feb 15, 2019
@ColbyTresness
Copy link

@mhoeger thoughts here?

@mhoeger
Copy link

mhoeger commented Feb 15, 2019

I'm a bit confused, I'm suspicious that this is a functions issue? babel/babel-loader#401

I think it would be good though to add that global state is global for the function app (not per function), but there are no guarantees about preserved state of a global var (alluded to here)

@ColbyTresness
Copy link

I'm comfortable closing then. Please repoen if the doc Marie referenced is insufficient.

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

No branches or pull requests

4 participants