-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Feature] Block Tunes API #1596
Conversation
…nto feature/block-tunes
…nto feature/block-tunes
…nto feature/block-tunes
Is there any time estimation when this will go into the main branch? |
src/components/block/index.ts
Outdated
[...this.tunesInstances.values(), ...this.defaultTunesInstances.values()] | ||
.forEach((tune) => { | ||
if (_.isFunction(tune.wrap)) { | ||
wrappedContentNode = tune.wrap(wrappedContentNode); |
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.
do we need to add try-catch statement here? To avoid rendering problems in case of an error on the tune side?
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.
same thing at the save()
method
@@ -237,10 +237,13 @@ export default class BlockSettings extends Module<BlockSettingsNodes> { | |||
} | |||
|
|||
/** | |||
* Add default settings | |||
* Add external tunes: provided by user and default ones |
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.
why external
? Looks like it appends both internal and external
src/components/tools/tune.ts
Outdated
* @param data - Tune data | ||
* @param block - Block API object | ||
*/ | ||
public instance(data: BlockTuneData, block: BlockAPI): IBlockTune { |
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.
i think create
or build
is more suitable here (for function name)
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
/** | ||
* Returns true if Tools is block | ||
*/ | ||
public isBlock(): this is BlockTool { |
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.
maybe it is better to rename this method to isBlockTool
? because Block is a product of a tool
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.
Usage would be tool.isBlock()
, so I think it's ok
Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com>
* Add tests for tools utils and coverage report * Fix eslint * Adjust test * Add more tests * Update after code review
No description provided.