Forum Replies Created
-
AuthorPosts
-
Zac Gordon
KeymasterHi Folks!
Just wanted to say thanks for all of you who have shared here 🙂
I have been following updates in Core closely and have a list of updates my own updates. I had thought I would be starting on an update around now but there are still some things settling and I got advice from Core devs not to start quite yet. Probably early – mid March.
Please continue to share up here anything you notice you want to see in the next update!!!
Zac Gordon
KeymasterWin for component architecture 🙂
Zac Gordon
KeymasterAw, missed this at first glance. Simple solution 🙂
You’re defining the component inside your edit function.
It’s best to pull it out into its own file or at least up outside of the registerBlockType function 🙂
Let me know if that doesn’t work!
Zac Gordon
KeymasterUnfortunately there are some issues with getting JS driven blocks to work on the frontend, as crazy as that sounds. This is something they are working on. This may be related, but may not be.
What specifically breaks in this example?
Zac Gordon
KeymasterHi @jdm
Thanks for this request. I will look into adding auto-play when I release the next update for the course. Some folks do not like this functionality, so if I add it, I want to make sure it is something that can easily be enabled or disabled and remember your preference.
Thanks!
Zac Gordon
KeymasterHi there! Sorry for the delay on this. I wanted to first release my Vanilla JS Course, which delves deeply into state before I responded so if you wanted to dig deeper, resources were available to do so 🙂
But in short, global scope is the scope stored in the window object and available to all JS files that load on the same page.
When you write const and use imports, webpack will wrap the variables in global scope to prevent them from leaking into the global scope 🙂
Also, as browsers evolve, the conversion of const to var can become less needed.
Hope that helps!
Zac Gordon
KeymasterHi David!
What is the specific problem you’re having?
Zac Gordon
KeymasterOh nice! Great catch 🙂
Thanks for sharing!!!
Zac Gordon
KeymasterI am less familiar with that Boilerplate but I have seen this error before. May have to do with using a unique key for inspector controls.
Does the same thing happen when you use the inspector control examples from this course example files?
Zac Gordon
KeymasterOhhhh that is interesting. Makes sense and sounds like they might change the priority so loads all the time or at least resolve the issue when it loads into Core.
Glad we got this sorted!!! Weird it only happens if your plugin name begins with something before G ;p
Zac Gordon
KeymasterHi there!
Couple of things:
1. Your blocks should go in a plugin, not the theme. You can bundle the theme to require the plugin tho
2. If you use webpack and babel all your JavaScript will be compiled into valid JS that should work in most modern browsers and you can set your fallback further if you want.Hope that helps! Please let me know if not 🙂
Zac Gordon
KeymasterAlso asked in #editor-js core channel for you 🙂
Zac Gordon
KeymasterHmmm this is weird. I am getting the same error as you. Played around a bit with it but not seeing a quick solution.
I would suggest try posting up here https://github.com/WordPress/gutenberg/issues and please let us know what you find!!!
Zac Gordon
Keymaster@mikemcalister Just pinging you here again since I moved this to it’s own thread 🙂
Zac Gordon
KeymasterOoops! Sorry! I missed that you were talking on the PHP side for a dynamic block!
Okay, that is weird. Can’t remember if I have come across it before..
A couple shots in the dark here (some of them are real stretches, but hopefully something helps):
– When you install the course example plugin (or another plugin with a dynamic block) does it give you the same error?
– Does ‘example/example-testimonial-list’ exist as an actual block?
– Is there possibly an error before that line?
– The Gutenberg plugin is installed, right?
– This function actually exists, right? atomic_testimonial_list_renderJust some thoughts on starting points.. Please let me know what you find!
Zac Gordon
KeymasterHey @mikemcalister
My guess is that this is because something like this is missing at the top of your code:
const { registerBlockType } = wp.blocks;
Is that it?
Zac Gordon
KeymasterGreat sharing!!! Wishing you luck!!!
Zac Gordon
KeymasterIf block content may change or need to be loaded dynamically then the suggested block architecture would be to use a dynamic block that is actually rendered on the frontend with PHP and therefor can stay dynamic.
Unless I’m misunderstanding, this may be a separate issue from the one mentioned about swapping templates, but still an important question!
Let me know if that answers your question.
Zac Gordon
KeymasterI have not seen any hooks or extensions to be able to do this. So at this time I believe the answer is no, we cannot create our own block categories. Not sure if that will change in the future or if it will stay locked in.
Zac Gordon
KeymasterAw thank you Ross!
I went and added links in the lesson notes.
Currently the link is in the main course page under Resources, but I understand that this is easy to miss and had meant to add the direct links. Thanks for pointing this out!!!
Zac Gordon
KeymasterOkay, a couple troubleshooting tips to start..
1. Is this the example code or code you typed out? Does the example code cause the same problem without any changes?
2. Double check the request is being made to the correct URL and that URL returns what you expect in the browser.The problem is the posts are not being grabbed, but there are a few steps at which this problem could occur.
Zac Gordon
KeymasterAt this time the course is only available in a streaming format. Sorry for any inconvenience.
Zac Gordon
KeymasterGreat feedback ya’ll! Please keep it coming. Will make sure to address this stuff in coming updates.
I am going to work on releasing some of my Master Course content to help people better understand things like webpack and NPM 🙂 This will be its own stand alone little mini course and not be part of this Gutenberg Development as Gutenberg Development assumes you already know modern JavaScript. But I’ll see if I can do a little mini course on getting up and running with modern JS!
Please keep the feedback coming!
Zac Gordon
KeymasterYeah, I played around with this a bit.
Run a command and it builds a plugin with a block.
Curious to see it evolve 🙂
January 20, 2018 at 12:51 pm in reply to: Mixed Content: The page was loaded over HTTP but requested an insecure styleshee #38910Zac Gordon
KeymasterOh good glad you got it solved!
I did post a patch to that css issue, but if it fixed it once it should continue to work properly for you 🙂
Please post up if you have any other issues!
-
AuthorPosts