Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

Feature slate v0.31.3 #51

Merged
merged 30 commits into from
Jan 11, 2018
Merged

Feature slate v0.31.3 #51

merged 30 commits into from
Jan 11, 2018

Conversation

gabrielrtakeda
Copy link
Contributor

Related issues

gabrielrtakeda and others added 25 commits November 28, 2017 13:13
@@ -1,4 +1,4 @@
export * from './SlateEditor'
export * from './slate-editor'
Copy link
Contributor

Choose a reason for hiding this comment

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

It would have been nice for renamed stuff like this to be done in a separate PR since there are already a ton of changes in this it's hard to review it with renames that aren't shown as renames

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately to make this separation in a new PR will require a lot of effort and I believe it is not worth ... But it was an excellent point that I need to pay more attention when doing this kind of refactoring...

@@ -85,7 +85,7 @@ class ImageDataModal extends Component {
name="openExternal"
onClick={e => e.stopPropagation()}
onChange={e => this.setImageAttribute(e, e.target.checked)}
checked={this.state.imageAttributes.openExternal}
checked={!!this.state.imageAttributes.openExternal}
Copy link
Contributor

Choose a reason for hiding this comment

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

Broken logic ideally would have also been fixed in a separate PR.

value={value}
onChange={onChange}
readOnly={readOnly}
changeState={changeState}
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't think changeState existed anymore....?
https://docs.slatejs.org/slate-react/editor

// From v0.25.3
// To v0.31.3
//
migrateStateVersion (value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is going to be common practice for SlateEditor to handle in the future, I think this migration logic should live in its own module and have tests.

Plus, the changes are already not backwards compatible, so why make this part concerned about compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abobwhite this compatibility function is needed because of the state object generated by previous version of slate... We currently save this state object into database and, according to changes on those state objects in this last version of slate, if it was not treated with a compatibility function, like this mentioned on this comment, the state object generated by previous version would break the editor on rendering time...

And, to make a script or a query to normalize all those previous state object on the database, it would require much more effort instead of creating a simple replace function with a regex...

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation. I totally understand the need here. But I'm not sure this belongs within slate-editor itself. This seems like something that should be handled by consumers of slate-editor for their specific use-cases. And if you insist that it stay in here, could it be broken out into a separate migration utility? That way people could use it by choice vs automatically happening under the hood? And if you still insist that it must remain under the hood, please break it out into a separate file/class and add some tests. This is definitely something that should not go forward without testing around it. It wouldn't be much work to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will decouple this Slate state object compatibility logic from slate-editor's project after this release... I believe it would not impact too much to end users of slate-editor because, if the condition to "migrate" the state object does not match, it will do nothing.

@abobwhite
Copy link
Contributor

@gabrielrtakeda Good work on this. Any thoughts on my review comments?

@abobwhite
Copy link
Contributor

@gabrielrtakeda My project is needing to update to the latest slate soon for IME support. Any chance we can wrap this up now? It's been out here 2 weeks. I can make adjustments on your branch if you'd like some assistance.

@gabrielrtakeda
Copy link
Contributor Author

Hi @abobwhite, we're making a big refactoring on our project and we will make a new release soon.. If you need to make some changes, fill free to use my branch and create a new PR to it...

@abobwhite
Copy link
Contributor

Thanks for the update, @gabrielrtakeda . Do you have any response to my review comments? I think the latter two need to be addressed.

@abobwhite
Copy link
Contributor

Hi @gabrielrtakeda Our project is nearing a major deadline that I need this to upgrade slate to get a fix for IME. Do you have any timetable for when you might be finishing your testing with the refactoring in your project? Specifically, an ETA to get this merged?

@abobwhite
Copy link
Contributor

@gabrielrtakeda @lpirola Any update on this? Can I help with something? We're hitting crunch time and need this change to be able to pull in the latest slate for IME fixes

@lpirola
Copy link
Contributor

lpirola commented Jan 5, 2018

@abobwhite we will delivery a new version next weekend. I guess we will couldn't respond to all your requests.

Feel free to propose pull requests to branch feature-slate-v0.31.3 and we could discuss changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants