Skip to content

Conversation

@latata
Copy link

@latata latata commented May 8, 2017

This is a proposal draft for conventions of Wikia App JavaScript modules structure. Feel free to expand it or leave your comments.

@kvas-damian @rogatty @fraszczakszymon @dianafa @slayful


Keep entry point files as small as possible. They should usually just execute some initialization functions from other files.
```
TODO: what if we want to have just one js file in extension?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would be the case when we 'want' such solution?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no need to create multiple files if we want to for example add just one button click handler.


return Tracking;
});
```
Copy link
Contributor

@dianafa dianafa May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case we have static methods only do we want to have convention regarding

Tracking.myStaticFunction1 = function () {
  // public non-static method
};

Tracking.myStaticFunction2 = function () {
  // public static method
};

return Tracking;

over

myStaticFunction1 = function () {
  // public non-static method
};

myStaticFunction2 = function () {
  // public static method
};

return {
  myStaticFunction1: myStaticFunction1,
  myStaticFunction2: myStaticFunction2
};

as well?

@lizlux
Copy link
Contributor

lizlux commented Jan 15, 2019

@latata is this still relevant or should we close this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants