The default bug view has changed. See this FAQ.

We should warn users when magical require is used

RESOLVED FIXED

Status

Add-on SDK
General
P1
normal
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: irakli, Assigned: ochameau)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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
Blocks: 793925
Target Milestone: --- → 1.14

Updated

4 years ago
Priority: -- → P1
(Assignee)

Comment 1

4 years ago
Created attachment 719527 [details]
Pull request 822

Updated

4 years ago
Target Milestone: 1.14 → ---
(Assignee)

Comment 2

4 years ago
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+
(Assignee)

Comment 4

4 years ago
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

4 years ago
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
(Assignee)

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 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 → ---

Updated

4 years ago
Blocks: 880558

Comment 7

4 years ago
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
(Assignee)

Comment 8

4 years ago
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
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED

Comment 9

4 years ago
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.