Last Comment Bug 841766 - We should warn users when magical require is used
: We should warn users when magical require is used
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Mac OS X
: P1 normal (vote)
: ---
Assigned To: Alexandre Poirot [:ochameau]
:
Mentors:
Depends on:
Blocks: 793925 880558
  Show dependency treegraph
 
Reported: 2013-02-15 08:18 PST by Irakli Gozalishvili [:irakli] [:gozala] [@gozala]
Modified: 2013-06-12 13:23 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Pull request 822 (165 bytes, text/html)
2013-02-28 08:58 PST, Alexandre Poirot [:ochameau]
rFobic: review+
Details

Description Irakli Gozalishvili [:irakli] [:gozala] [@gozala] 2013-02-15 08:18:19 PST
We have created https://github.com/mozilla/addon-sdk/blob/master/mapping.json to allow backwards compatible require statements to old add-ons. But the problem is that we end up using deprecated patterns ourselfs and likely add-ons do it too.

CFX should log deprecation warning whenever forms from mapping are normalized and suggest use of normalized form instead.
Comment 1 Alexandre Poirot [:ochameau] 2013-02-28 08:58:01 PST
Created attachment 719527 [details]
Pull request 822
Comment 2 Alexandre Poirot [:ochameau] 2013-03-20 10:00:23 PDT
Comment on attachment 719527 [details]
Pull request 822

This patch is ready but I'm not totally confindent that we should land it as-is.
First, we would need to communicate about this before landing/releasing.
We would also need to update all documentation.

Here I'm printing a warning if we do require("panel") instead of require("sdk/panel"). Or require("self") instead of require("sdk/self") is that what we want?
Comment 3 Irakli Gozalishvili [:irakli] [:gozala] [@gozala] 2013-03-20 17:05:07 PDT
Comment on attachment 719527 [details]
Pull request 822

As pointed out in pull I think it's ok to land this as is and figure how to avoid warnings for tests that explicitly test for deprecated paths.

One option could be to move these tests to the python side and just test that modules are resolved as expected.
Comment 4 Alexandre Poirot [:ochameau] 2013-06-06 15:38:47 PDT
I rebased this patch and it wasn't failing on deprecated paths tests as I has some special workaround for that in the patch (ignore-deprecated-path flag).

Irakli, as your r+ this patch long time ago,... are you still up to land this patch?
Comment 5 [github robot] 2013-06-06 17:06:43 PDT
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/b8247ed5d17376ede0057f0a2fb53a448ae6563d
Bug 841766 - We should warn users when magical require is used

https://github.com/mozilla/addon-sdk/commit/66098bc6923ee78d6d73d68aa8d80a4dc341494a
Merge pull request #822 from ochameau/deprecate-mapping

Bug 841766 - We should warn users when magical require is used r=@gozala
Comment 6 Wes Kocher (:KWierso) 2013-06-06 17:45:14 PDT
Reopening because I had to revert this pull request for causing lots of ModuleNotFoundError regarding the sdk/xul-app module:
https://github.com/mozilla/addon-sdk/commit/f457b217c77310cda48da77ced4a981ecbed3bd7

https://tbpl.mozilla.org/php/getParsedLog.php?id=23881262&tree=Jetpack&full=1 is an example of the error.
Comment 7 [github robot] 2013-06-07 01:15:10 PDT
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/6b294fe98e7c2b5d546c59f79daed3fb0f8fdbf0
Merge pull request #822 from ochameau/deprecate-mapping

Bug 841766 - We should warn users when magical require is used r=@gozala
Comment 8 Alexandre Poirot [:ochameau] 2013-06-07 01:49:41 PDT
I was using a wrong path when replacing this new require statement during rebase.
I fixed it, I hope that's good now!
Comment 9 [github robot] 2013-06-12 13:23:50 PDT
Commit pushed to integration at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/6b294fe98e7c2b5d546c59f79daed3fb0f8fdbf0
Merge pull request #822 from ochameau/deprecate-mapping

Note You need to log in before you can comment on or make changes to this bug.