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

Wordpress 5 #110

Merged
merged 3 commits into from
Dec 12, 2018
Merged

Wordpress 5 #110

merged 3 commits into from
Dec 12, 2018

Conversation

ViorelEremia
Copy link
Contributor

@danyj
Copy link

danyj commented Dec 6, 2018

Works fine on WP5 but the new WP preview is veryyyyy slow on my end. Not sure if it is Unyson related.
Can some of you advise if you are seeing the same thing on your end.

On to test on WP 4.x

@danyj
Copy link

danyj commented Dec 6, 2018

Page options previews have no affect at all anymore on WP5

If you have any page options http://prntscr.com/lrkv6i , they kinda worked on pre 5 on previews,
now on 5 you dont see any custom page options when preview mode. You see them only on save

@danyj
Copy link

danyj commented Dec 6, 2018

Builder elements container position on scroll is not right
http://prntscr.com/lrl07t

@andronic90
Copy link

Yes, I confirm that preview on page it's slow, but this was slow when I tested gutenberg, need to inspect more the cause

@danyj
Copy link

danyj commented Dec 6, 2018

I am digging since few H now and cant nail it ,
found these

WordPress/gutenberg#7703
WordPress/gutenberg#7561
WordPress/gutenberg#6331

but was not able to find what is causing it. Looks like autosave issue and isSaveable

https://github.com/WordPress/gutenberg/blob/299f406325d5b6fb3a6bcf973664b84a10136552/editor/store/effects.js#L104-L108

@danyj
Copy link

danyj commented Dec 6, 2018

this was slow when I tested gutenberg

yes that is what I mean , only with Gutenberg on

first time I go in page and click preview loads ok,
all other times it hangs several minutes, but no errors , 400 or anything similar

@ViorelEremia
Copy link
Contributor Author

Yes, the options in preview don't work. I tried to fix it but I don't understand how it works. They changed a lot of things on save_post, and still change
About ```preview is very slow```` I can't see it, for me, it is very fast. I tried with themes like creatus, the-core, scratch

@danyj

Builder elements container position on scroll is not right
http://prntscr.com/lrl07t

have you both pull requests?
I installed your deom Clean ( developer demo )and it is all right. I see you use the old tinymce editor how to enable the new one

@danyj
Copy link

danyj commented Dec 12, 2018

@ViorelEremia add this in functions.php to enable GB

/*
 * Disable/enable block editor
 * in case you need some logic see:
 * https://gist.github.com/danyj/ec00057550fd6f73995ab2f8fc8b729f
 */
function _thz_filter_disable_block_editor_pt( $use_block_editor, $post_type ){

  $use_block_editor = true;
  return  $use_block_editor;

}

Yes, the options in preview don't work.

I tried also but no luck , one thing that I see is that any change in builder and page setting depends on the content and builder being active

$content.val( '<!-- ' + fw.md5( builderInput.value ) + ' -->' );

if builder is not active and you change any page options and dont touch the editor there is no autosave
thus we keep on seeing the old options. This issue seems same with GB or without. Basically preview depends on autosave and if there is none , no changes are seen.

So I say that a page options set should somehow trigger autosave .

@danyj
Copy link

danyj commented Dec 12, 2018

I installed your demo

You dont need any demos to see these issues. It is just clutter for you if you are testing.
You can test with the theme only and same thing happens.

@ViorelEremia
Copy link
Contributor Author

Ok I enabled the editor but i cant see this on your unyson pages #110 (comment)

@danyj
Copy link

danyj commented Dec 12, 2018

Ok I enabled the editor but i cant see this on your unyson pages

add some longer page from library and scroll ,
I think Yoast has same issue, things showing up in mid of the screen on GB

@ViorelEremia
Copy link
Contributor Author

I have and Yoast and a long page and nothing

@ViorelEremia
Copy link
Contributor Author

ViorelEremia commented Dec 12, 2018

With the new editor we can't use anymore $content.val( '<!-- ' + fw.md5( builderInput.value ) + ' -->' ); we must trigger a change in the dom so react can't track it.
Now when you click on preview all options go to the server through an ajax request but on the server, I can't know when is a save and when is an autosave preview so now all options are saved as an autosave to the current post, not to revision as before

@danyj
Copy link

danyj commented Dec 12, 2018

I have and Yoast and a long page and nothing

strange , I still see that
http://take.ms/dtEJU

seems like top on scroll is miscalculated

http://prntscr.com/ltzy18

@ViorelEremia
Copy link
Contributor Author

are you sure you have both pull request on your server?

@ViorelEremia
Copy link
Contributor Author

I'm going to merge these two pull requests because we have a lot of users who want to use the new wp editor with unyson.
About options in the preview, I will try to fix them later maybe meanwhile, some wp docs may also appear

@danyj
Copy link

danyj commented Dec 12, 2018

if you say so. as long as the old editor is functional.

note , dont forget to change tested with on WP http://prntscr.com/lu09f5

@danyj
Copy link

danyj commented Dec 23, 2018

@ViorelEremia

possible solution for page options

		// trigger autosave on preview click to save page options
		if ( wp.autosave.server ) {
			$('#post-preview').on( 'click.post-preview', function( event ) {
				wp.autosave.server.triggerSave();
			});
		}

and see this please #112

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.

3 participants