New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Architecture #9
Architecture #9
Conversation
@@ -1,22 +0,0 @@ | |||
The MIT License (MIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License can remain MIT
I can't say I know all the pros and cons. But I like the if (true) {
transloadit.use(require('transloadit-client-instagram'), {
only_sepia: false,
});
} |
i like the for instance,
could be:
|
+1 |
Here is what Andrey (the creator of PostCSS) replied to me:
|
Ha-ha, ok, so he says “if you are building a JS SDK, use the API from markdown-it [meaning |
Okay that settles it : ) Please cement this choice in |
+1 on .use() and +1 on chaining. As for the class discussion: I am happy to only expose one function and not classes. I have read through other JS SDKs of competitors and I liked how easy they were to use with just one function exposed. And I think with
|
All right. Not sure we should mix themes and plugins, though. |
A question. If we do |
+1 for plugin functions. it would save us from needing to update the core any time we added a new plugin. also easier for third-party plugins to be written by the community. I think we should bundle the main plugins with the client. it could be used:
|
What is happening. |
+1 as well on this
What about: |
Is theme a plugin tough? Won’t it just be a styles file? But yeah, we should probably distinguish between upload methods and crop or other functionality. |
Good question. But I would like to ship a few styles. And maybe allow people to set just the primary color. This is how other companies (like intercom) currently provide customization - and it works pretty well actually. It should of course be possible to roll your own css - but I don't think anything stands in the way of that.
Thinking about this more - and especially after #19 (comment), I'm currently leaning towards only having a |
Nice work @arturi! I'll fork off the remaining subtodos and close this massive one! Smaller more focused iterations are possible after this! |
We can play with the draft code here: https://jsbin.com/vupurugona/edit?js,console
There are two main issues that I faced and that we need to discuss:
How to register plugins
Two ways I’ve found that are worth investigating:
The PostCSS way: Starts with
postcss.plugin
function, which is defined here. Function returns a function, you can add plugins like this:The Markdown-It way: They went with a
use
function that calls the plugin with options you passed to it:Use of class
From what I gathered some are using classes happily, some expose the API and want the users to do
let markdown = new Markdown()
, while others, like PostCSS, expose the function only, which creates a new instance inside itself and uses that internally.Todo in this PR
LICENSE
README.md
.js
/.es6
Should we use.es6
extensions? #10