Closed Bug 1454827 Opened 3 years ago Closed 1 year ago

Source actor spec should use `source` instead of `onSource`


(DevTools :: General, enhancement, P3)



(firefox70 fixed)

Firefox 70
Tracking Status
firefox70 --- fixed


(Reporter: jryans, Assigned: malikanshul29)


(Blocks 1 open bug)



(2 files)

Source actor's spec includes:

    onSource: {
      request: { type: "source" },
      response: RetVal("json")

which is unusual, since the request's type would be "source" if the method were renamed to that.  We should explore renaming the method and removing the type to match typical style.
Product: Firefox → DevTools
Assignee: nobody → mtigley
Comment on attachment 8991100 [details]
Bug 1454827 - Source actor spec should use `source` instead of `onSource`.

Thanks a lot for thaking this on Micah! I realized too late that the name I suggested to you wasn't the best one, so I wrote a comment regarding that. Otherwise looks really good.

::: commit-message-6073e:1
(Diff revision 1)
> +Bug 1454827 - Source actor spec should use `source` instead of `onSource`. r=jryans,yulia

nit: we usually write what was done in the commit rather than the bug name: in this case "replace onSource with source in Source Actor and Source Actor Spec"

::: devtools/server/actors/source.js:190
(Diff revision 1)
>      return this._threadActor.sources;
>    },
>    get dbg() {
>      return this.threadActor.dbg;
>    },
> -  get source() {
> +  get sourceData() {

I just realized that a better name for this is `originalSource`. 

We have two types of source that we can get. `generatedSource` is a compiled source, like something you get out of webpack when you bundle. `originalSource` is a representation of the file that a programmer was working on when they were writing their code.

I would propose that we rename sourceData to originalSource, because then we are consistant with generatedSource. Sorry it took me a while to think of that!
Attachment #8991100 - Flags: review?(ystartsev) → review+
Comment on attachment 8991100 [details]
Bug 1454827 - Source actor spec should use `source` instead of `onSource`.

Thanks for working on this! :) I agree with Yulia's comments.
Attachment #8991100 - Flags: review?(jryans) → review+

This bug has not been updated in the last 6 months. Resetting the assignee field.
Please, feel free to pick it up again and add a comment outlining your plans for it if you do still intend to work on it.
This is just trying to clean our backlog of bugs and make bugs available for people.

Assignee: mtigley → nobody
Assignee: nobody → malikanshul29
Pushed by
Rename onSource to source in source actor r=yulia
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
You need to log in before you can comment on or make changes to this bug.