Skip to content
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

Merged
merged 29 commits into from
Apr 4, 2021
Merged

[Feature] Block Tunes API #1596

merged 29 commits into from
Apr 4, 2021

Conversation

gohabereg
Copy link
Member

No description provided.

@gohabereg gohabereg mentioned this pull request Mar 15, 2021
4 tasks
@gohabereg gohabereg changed the base branch from next to reafctoring/tools March 15, 2021 06:15
@gohabereg gohabereg marked this pull request as ready for review March 17, 2021 05:00
@christoph-kluge
Copy link

Is there any time estimation when this will go into the main branch?

src/components/block/index.ts Show resolved Hide resolved
src/components/block/index.ts Show resolved Hide resolved
src/components/block/index.ts Show resolved Hide resolved
[...this.tunesInstances.values(), ...this.defaultTunesInstances.values()]
.forEach((tune) => {
if (_.isFunction(tune.wrap)) {
wrappedContentNode = tune.wrap(wrappedContentNode);
Copy link
Member

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?

Copy link
Member

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

src/components/modules/saver.ts Show resolved Hide resolved
src/components/modules/tools.ts Show resolved Hide resolved
Base automatically changed from reafctoring/tools to next March 31, 2021 20:29
@@ -237,10 +237,13 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
}

/**
* Add default settings
* Add external tunes: provided by user and default ones
Copy link
Member

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

types/configs/editor-config.d.ts Outdated Show resolved Hide resolved
types/data-formats/output-data.d.ts Show resolved Hide resolved
* @param data - Tune data
* @param block - Block API object
*/
public instance(data: BlockTuneData, block: BlockAPI): IBlockTune {
Copy link
Member

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)

gohabereg and others added 3 commits April 2, 2021 19:09
docs/block-tunes.md Outdated Show resolved Hide resolved
docs/block-tunes.md Show resolved Hide resolved
docs/block-tunes.md Outdated Show resolved Hide resolved
docs/block-tunes.md Outdated Show resolved Hide resolved
docs/block-tunes.md Outdated Show resolved Hide resolved
gohabereg and others added 2 commits April 2, 2021 20:46
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 {
Copy link
Member

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

Copy link
Member Author

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>
gohabereg and others added 2 commits April 4, 2021 11:38
* Add tests for tools utils and coverage report

* Fix eslint

* Adjust test

* Add more tests

* Update after code review
@gohabereg gohabereg merged commit 2d89105 into next Apr 4, 2021
@gohabereg gohabereg deleted the feature/block-tunes branch April 4, 2021 12:10
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