[nodebb-plugin-magicblock] Macros, Color, Embeding
- I guess the lib/defaults.js is never used and duplicates lib/magicblock/defaults.js, just a side note xD
Actually I use magicblock as a sepereated module, and
plugin side defaultswhich can be different from
magicblock defaults, (they are yet same but.. ). Now,
buildOptionsis called twice in
lib/magicblock/index.jswith different(but same)
- There are a few tools at
npmyou could use rather than creating your own utilities I prefer
lodash(link), it's written for performance and consistency of usage. Your
buildOptionswould get replaced by
_.mergefor example. It's really not a deal to have dependencies for such matters. Plus knowing a utilities features helps a lot keeping code to necessary stuff.
Yes, after I learned
lodashfrom your emoji plugin, I thought exactly same thing. Thanks twice :).
- I see some space for improvement here; Checking
opts.attrStrAllowColorfirst would improve the code and performance.
.npmignorefile does not extend of a
.gitignore, you have to either fill it properly or remove it entirely (in this case npm will use the
.gitignore). You have some a bit of trash within your npm release
This is really something new I have never known.
I will quickly improve 3,4 first.
I got a question if this plugin works under v0.9.4.
But I tested/developed this my first plugin with only with v1.0.0, and have no idea about version compatibility.
What I can imagine to are
- Study what changed between v0.9.4 and v1.0.0
- Install v0.9.4 and test.
- Ask volunteers who (will) test the plugin with one's v0.9.4
Could anybody give better or recommendable ideas?
@julian HI, I needed you 30 minitues ago!!
I just found out this
acpScriptsafter an hours testing and debuging.
I have(had) to read that post also.
Here is a link for others ( to save server resource from searching)
Actually, I have an question related with
So if I want to support v0.9.4 then what is best way?
- put a
admin.js( commonly called ) to both of
- put it to only
scriptsand remove from
- embed into an admin tpl of a plugin.
I guess most effective way to support both versions is 3.
Could you let me know the best way?
- put a
@qgp9 You can embed the script into the template -- depends how comfortable you are with mixing your templates and client-side code, in terms of organisation
In order to support both, you'd have to maintain two branches in git. One for each level of support. You'd need to ensure the
nbbpm.compatibilityvalues are set to the appropriate values in each branch's
package.json, and npm publish them both (though npm will show the readme of the latest published version).
nbbpm should be smart enough to figure out that different versions have different compatibilities and adjust its records accordingly. If not, let me know,.