Skip to content

🎪 Change the way platforms are imported ⚠️ DO NOT MERGE ⚠️#93

Open
stojanovic wants to merge 2 commits intomasterfrom
feat/platforms
Open

🎪 Change the way platforms are imported ⚠️ DO NOT MERGE ⚠️#93
stojanovic wants to merge 2 commits intomasterfrom
feat/platforms

Conversation

@stojanovic
Copy link
Copy Markdown
Member

@stojanovic stojanovic commented Mar 12, 2017

Goal: update the structure so we can import new platforms without adding them to the core and add plugin support.

To do:

  • Update structure and allow users to pass an instance of the platform class in platforms list
  • Automatically export items defined in platform class constructor
  • Export platform classes
  • Review
  • Trigger postDeploy method in post deploy
  • Add more tests
  • Beta test each platform

@stojanovic stojanovic requested review from gojko and simalexan March 12, 2017 22:12
@stojanovic stojanovic changed the title 🎪 Change the way platforms are imported 🎪 Change the way platforms are imported [DO NOT MERGE] Mar 12, 2017
@stojanovic stojanovic changed the title 🎪 Change the way platforms are imported [DO NOT MERGE] 🎪 Change the way platforms are imported [⚠️ DO NOT MERGE ⚠️] Mar 12, 2017
@stojanovic stojanovic changed the title 🎪 Change the way platforms are imported [⚠️ DO NOT MERGE ⚠️] 🎪 Change the way platforms are imported ⚠️ DO NOT MERGE ⚠️ Mar 12, 2017
Comment thread lib/bot-builder.js
module.exports.SlackPlatform = SlackPlatform;
module.exports.TelegramPlatform = TelegramPlatform;
module.exports.TwilioPlatform = TwilioPlatform;
module.exports.ViberPlatform = ViberPlatform;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this can be one object

module.exports = {
  AlexaPlatform: AlexaPlatform,
  ...
};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍

Comment thread lib/viber/platform.js
}
}

module.exports = ViberPlatform;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if we compare the platform.js for all of these platforms we come to an identical structure, with the difference in just its parameters and enabled template()
~
maybe it can be a single object, with different params and a templates enabled or disabled

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It can, but the point is that this can be fully customized by any new plugin. We can probably create a base class and extend it.

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.

2 participants