Closed Bug 841766 Opened 11 years ago Closed 11 years ago

We should warn users when magical require is used

Categories

(Add-on SDK Graveyard :: General, defect, P1)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: irakli, Assigned: ochameau)

References

Details

Attachments

(1 file)

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.
Assignee: nobody → poirot.alex
Target Milestone: --- → 1.14
Attached file Pull request 822
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?
Attachment #719527 - Flags: review?(rFobic)
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.
Attachment #719527 - Flags: review?(rFobic) → review+
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?
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
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
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
I was using a wrong path when replacing this new require statement during rebase.
I fixed it, I hope that's good now!
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: