Just notes on problems I face:
-
Testing with Jest in a node and ReactJS monorepo (and getting rid of environment.teardown error)
Big number of the applications we develop have at least one ReactJS UI, that is held in one repo and an API, held in another. If we need to reuse some part of the code, we do so by moving it to another repository and adding it as a git submodule For our latest project…
-
The new react hooks useShiny
Recently a new proposal have been released to the ReactJS community – for React Hooks. Roughly, the React Hooks are new ways to utilize the react features, that were previously available only via the JS class syntax. I cannot hide my excitement for the hooks because they: Simplify the code that is written Make the…
-
Ninio’s Learning Notes [Reload]
I’ve decided to restart blogging and moved my blog from its old location (ninio.shtrak.eu) to the one here.
-
JS variable loaded using wp_localize_script is no longer available
TL;DR: Call the wp_localize_script after registering/enqueuing the script you are localizing. Recently (WP 4.1.4 / WP 4.2) my ajax scripts stopped working. I’ve noticed that it was caused by the fact that the variable for the ajax_url was undefined so for some reason it ws no longer loaded to the page. The reason turned out…
-
Retrieving data from a form created with Contact Form 7
If you want to get the data from a form created with Contact Form 7 you can use the ‘wpcf7_before_send_mail’ hook. In your functions.php or from your plugin add action like follows: add_action( ‘wpcf7_before_send_mail’, ‘my_plugin_wpcf7_before_send_mail’ ); function my_plugin_wpcf7_before_send_mail ( $contact_form ) { // TODO: get the data } Since version 3.9 Contact Form 7 removed $contact_form->posted data so…
-
geeneric.com is live
We at Shtrak have been working lately on a WordPress and WooCommerce based platform for online shops. You can create your eCommerce site for free on geeneric.com Let me know what do you think about our service – I’m open to any ideas for improvement!
-
The native Facebook app on Android is no longer forcing you to use Messenger
Today I found out that the native Facebook app is no longer forcing me to use Messenger! At least on my Nexus 4. Seems like in the end they understood that forcing a user to do something is never the right way. From now on feel free to uninstall the crappy Messenger and use the…
-
Writing Vanilla JS that you can support
– JS can suck when written badly Everybody have heard at least on person to say that JavaScript is bad because it’s messy. And everybody have seen a poorly written JS. The big pros of JS makes some people think that they lead to hige cons. Everybody loves to use JS to get a small thing done…
-
JavaScript Събития (Custom Events) без DOM простотиите
Събитията са много добра техника да направите кода си независим между различните модули. С тях може да пишете значително по-добър и по-лесен за поддръжла JS. Въпреки това има много случаи в които няма нужда обектите в кода да разчитат на DOM дървото за да вдигат събития. (Например когато репрезентацията на самия обект е на няколко места…
-
JavaScript Custom Events that are not DOM related
Events is a great technique to loose code coupling. JS Custom Events was a big step to help the front-end developers write better JS. Despite this there are many cases where you don’t have your app objects represented in the DOM tree. And do you always have to trigger this event to the DOM when you don’t actually…