Skip to content

Conversation

@brandenrodgers
Copy link
Contributor

Just a POC, not intended to be merged!

This makes a few pretty drastic changes to the project structure just to highlight some ideas. The main goal was to see how much overall configuration we could (potentially) get rid of. Presumably, removing the total amount of configuration would make it easier to create a system that prioritizes convention, but also supports overrides to the default behavior via configuration.This is purely just for the sake of conversation. More info in comments.

@@ -2,14 +2,5 @@
"name": "Example App",
"description": "An example private app that contains a single card extension.",
"scopes": ["crm.objects.contacts.read", "crm.objects.contacts.write"],
"public": false,
"extensions": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is replaced by new naming conventions:

  • app.functions -> app.extensions
  • example-card.js -> example-card.card.js

const axios = require("axios");

exports.main = async (context = {}, sendResponse) => {
const appConfig = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This replaces example-card.json. It also replaces serverless.json b/c secrets is moved into this json. We no longer need a file that links the appFunction to the app config because they live in the same file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this first version. I'm sure you all will discuss more and iterate on this, but pumped to see where it's going.

Choose a reason for hiding this comment

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

Does app config in code invite dynamicism?

@@ -1,4 +1,3 @@
{
"name": "project_name",
"srcDir": "src"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an example of where we can implement convention over configuration. By default we will assume the src folder is the srcDir. The user is able to override this default behavior though.

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.

4 participants