jhnns / rewire-webpack

Dependency injection for webpack bundles
The Unlicense
121 stars 20 forks source link

Deprecation warnings in browser console #8

Open bultas opened 9 years ago

bultas commented 9 years ago

Hi,

Firstly, I would like to thank you for very useful module.

I'm using rewire with webpack bundle, but after upgrade webpack to version 1.4.13 I'm getting some warning messages in console.log

Warning 1:

'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.

Warning 2:

'webkitIndexedDB' is deprecated. Please use 'indexedDB' instead.

But everything seems that works properly yet. But I write better now than when it's too late.

jhnns commented 9 years ago

Thanks for the notification. But it seems to me that the error messages are not related to rewire-webpack because I don't use these properties. There are actual just a few lines of code of rewire-webpack that run in the browser. The main part is done during webpack compilation.

Both warnings are caused by the same problem: I guess you're using some browser-based database (Probably level.js or indexedup?) which tries to access deprecated properties.

bultas commented 9 years ago

It's interesting .. because if i dont use rewire in my test file warning disappears..

Maybe can be problem with phantomJS which I'm using to open final test bundle.. (but with warnings only if i use rewire)

hmm .. i will have to explore more deeply..

bultas commented 9 years ago

The warnings appears at getImportGlobalsSrc function on line 28 https://github.com/jhnns/rewire/blob/master/lib/getImportGlobalsSrc.js#L28

jhnns commented 9 years ago

Ah, that makes sense... the warnings are outputted when such a property is accessed. It's safe to ignore these warnings.

Unfortunately rewire still needs to access these variables because there might be code mocking these properties although they are deprecated now.

srph commented 9 years ago

Is this still an issue? I'll try it out now on 1.7.*. If ever, I'll update the outcome.

jhnns commented 9 years ago

Yep, it will not go away soon. rewire needs to access these properties...

srph commented 9 years ago

Alright :smile:! But these are merely warnings and do not affect test results, right?

jhnns commented 9 years ago

Yep, they occur because the browser thinks that your application is accessing these deprecated properties.