Title: JavaScript Chat Summary – November 6th
Author: Andrew Duthie
Published: November 7, 2018

---

 [  ](https://profiles.wordpress.org/aduth/) [Andrew Duthie](https://profiles.wordpress.org/aduth/)
7:33 pm _on_ November 7, 2018     
Tags: [javascript ( 130 )](https://make.wordpress.org/core/tag/javascript/)

# JavaScript Chat Summary – November 6th

Below is a summary of the discussion from this week’s JavaScriptJavaScript JavaScript
or JS is an object-oriented computer programming language commonly used to create
interactive effects within web browsers. WordPress makes extensive use of JS for
a better user experience. While PHP is executed on the server, JS executes within
a user’s browser. [https://www.javascript.com](https://www.javascript.com/) chat(
[agenda](https://docs.google.com/document/d/1WXJGXLnB2mE5m0GMQRExKJhx8u8ZnGI79lwWbxFq0XA/edit),
[Slack transcript](https://wordpress.slack.com/archives/C5UNMSU4R/p1541512806105200)).

Have a topic for discussion for the next meeting? Leave a suggested edit on [next week’s agenda](https://docs.google.com/document/d/1YKsfuLdoWLoP-itrAFc9BhsWbXfKZsckXX2fnsonRRo/edit).

## Node LTS 10.13.0

With the tagging of a new Node LTS 10.13.0 last week (from 8.x), both GutenbergGutenberg
The Gutenberg project is the new Editor Interface for WordPress. The editor improves
the process and experience of creating new content, making writing rich content 
much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML
etc. [https://wordpress.org/gutenberg/](https://wordpress.org/gutenberg/) and CoreCore
Core is the set of software required to run WordPress. The Core Development Team
builds WordPress. builds are now running the latest version.

## Data Module Generic Store APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways.

 A [refactoring of the data module](https://github.com/WordPress/gutenberg/pull/10289)
has been merged, and it now exposes a new optional lower-level API for non-Redux
stores, or more personalized instances of a Redux store.

Refer to [the documentation](https://github.com/coderkevin/gutenberg/blob/d0c6dbad1e002d2e189e1e030abb066096553811/packages/data/README.md#generic-stores)
for more information.

## JavaScript Future Backwards Compatibility (and ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. 󠀁[https://reactjs.org](https://reactjs.org/)󠁿)

**Discussion:** How can WordPress continue its commitment to backwards-compatibility
while also not perpetually lagging behind the current version of dependencies (specifically,
but not exclusively React).

**Considerations:**

 * Explore what it could look like to version WordPress scripts
 * Targeting the abstraction (`wp.element`) an intentional point in ensuring consistent
   version use.
 * Provide and/or surface [codemods](https://github.com/facebook/jscodeshift) if
   it comes to the point of being forced to introduce a breaking change (Facebook
   [does similarly](https://github.com/reactjs/react-codemod) with React)
 * Gutenberg’s deprecation pattern is not something which would necessarily continue
   post-5.0, but could serve as precedent for a future deprecation model

**Action Items:**

 * Compile a document which outlines expectations for a pluginPlugin A plugin is
   a piece of software containing a group of functions that can be added to a WordPress
   website. They can extend functionality or add new features to your WordPress 
   websites. WordPress plugins are written in the PHP programming language and integrate
   seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory
   [https://wordpress.org/plugins/](https://wordpress.org/plugins/) or can be cost-
   based plugin from a third-party. author to anticipate and account for future 
   compatibility, how and when a breaking change would be introduced

## Implementing End-to-End Tests in Core

_[Continuation of discussion from last week.](https://make.wordpress.org/core/2018/10/31/javascript-chat-summary-october-30th/)_

**Problem:** How can Gutenberg’s end-to-end test suite be brought into the core 
development workflow?

**Considerations:**

 * Not blocking for a 5.0 release
 * Tracked at [#45165](https://core.trac.wordpress.org/ticket/45165)
 * Having an end-to-end testing solution is useful for more than just the editor,
   and useful for more than just core development

**Solutions:**

Make some core part of the end-to-end solution available in `[@wordpress/scripts](https://www.npmjs.com/package/@wordpress/scripts)`.

## i18ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see 󠀁[localization](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?output_format=md#l10n)󠁿. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill. Core Merge Update

[@omarreiss](https://profiles.wordpress.org/omarreiss/) shared the following update:

> _WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative
> and development tasks in a programmatic way. The project page is [http://wp-cli.org/](http://wp-cli.org/)
> [https://make.wordpress.org/cli/](https://make.wordpress.org/cli/)_: Make sure`
> wp i18n` CLICLI Command Line Interface. Terminal (Bash) in Mac, Command Prompt
> in Windows, or WP-CLI for WordPress. command includes JavaScript translations 
> when generating potfiles. [Done] Relevant PRs: [https://github.com/wp-cli/i18n-command/pulls?q=is%3Apr+is%3Aclosed+author%3Aherregroen](https://github.com/wp-cli/i18n-command/pulls?q=is%3Apr+is%3Aclosed+author%3Aherregroen).
> 
> _MetaMeta Meta is a term that refers to the inside workings of a group. For us,
> this is the team that works on internal WordPress sites like WordCamp Central 
> and Make WordPress._: generate translations on translate.wordpress.orgWordPress.
> org The community site where WordPress code is created and shared by the users.
> This is where you can download the source code for WordPress core, plugins and
> themes as well as the central location for community conversations and organization.
> [https://wordpress.org/](https://wordpress.org/) for core, themes and plugins.[
> MVPMinimum Viable Product "A minimum viable product (MVP) is a product with just
> enough features to satisfy early customers, and to provide feedback for future
> product development." - [WikiPedia](https://en.wikipedia.org/wiki/Minimum_viable_product)
> Done] Ticketticket Created for both bug reports and feature development on the
> bug tracker.: [https://meta.trac.wordpress.org/ticket/3748](https://meta.trac.wordpress.org/ticket/3748)
> _Meta_: generate and serve JSJS JavaScript, a web scripting language typically
> executed in the browser. Often used for advanced user interfaces and behaviors.
> language packs from translate.wordpress.org for core, themes and plugins. [Has
> patchpatch A special text file that describes changes to code, by identifying 
> the files and lines which are added, removed, and altered. It may also be referred
> to as a **diff**. A patch can be _applied_ to a codebase for testing.] Ticket:
> [https://meta.trac.wordpress.org/ticket/3876](https://meta.trac.wordpress.org/ticket/3876).
> _Core_: Logic to load JS translations. [Done] Ticket: [https://core.trac.wordpress.org/ticket/45103](https://core.trac.wordpress.org/ticket/45103)
> _Core_: API to register JS translations for a script. Needs meta side of things
> to be finished. [Has patch] Ticket: [https://core.trac.wordpress.org/ticket/45161](https://core.trac.wordpress.org/ticket/45161)
> _Make_: Publish an update and a devnotedev note Each important change in WordPress
> Core is documented in a developers note, (usually called dev note). Good dev notes
> generally include a description of the change, the decision that led to this change,
> and a description of how developers are supposed to work with that change. Dev
> notes are published on Make/Core blog during the beta phase of WordPress release
> cycle. Publishing dev notes is particularly important when plugin/theme authors
> and WordPress developers need to be aware of those changes.In general, all dev
> notes are compiled into a Field Guide at the beginning of the release candidate
> phase. on how the JS translations work. [todo @omarreiss / @herregroen]

[@herregroen](https://profiles.wordpress.org/herregroen/) shares that for most plugin
authors who host their plugins through the plugin repository, the change in workflow
should be a matter of using `wp_set_script_translations` in place of where traditionally
one would use `wp_localize_script`.

## Reflecting on `@wordpress/hooks`

**Prompt:** As a retrospective of how `wp.hooks` has been used in the development
of core, what feedback do developers have to share?

**Feedback**:

 * [@youknowriad](https://profiles.wordpress.org/youknowriad/) : “In general I’m
   thinking JavaScript is not a good fit for our hooksHooks In WordPress theme and
   development, hooks are functions that can be applied to an action or a Filter
   in WordPress. Actions are functions performed when a certain event occurs in 
   WordPress. Filters allow you to modify certain functions. Arguments used to hook
   both filters and actions look the same. because JavaScript is a real time UIUI
   User interface not like PHPPHP The web scripting language in which WordPress 
   is primarily architected. WordPress requires PHP 7.4 or higher where the flow
   is linear. The UI has to be Reactive and it’s very hard to achieve with hooks
   without pitfalls.”
 * [@omarreiss](https://profiles.wordpress.org/omarreiss/) : “I think it might also
   not be the pattern we want to teach the WP community.”
 * [@herregroen](https://profiles.wordpress.org/herregroen/) : “I would give some
   thought to deprecating before release to send a clear message going forward. 
   I think it would be confusing to have this familiar API and then never expand
   it and soon after start deprecating it.”
 * [@aduth](https://profiles.wordpress.org/aduth/) : “My general experience with
   them is that they’re not completely avoidable, but in the majority of cases I’ve
   seen them proposed, it’s been the wrong way to go about a problem with some serious
   non-obvious consequences and I’ve thus looked to them as a “footgun” (a tempting
   tool too easy to use wrongly)”
 * [@adamsilverstein](https://profiles.wordpress.org/adamsilverstein/) : “i’ve mainly
   tried using the withFilters HOC which seemed to work well, i’m not really sure
   where else hooks have been used in Gutenberg. I agree they can easily be misused
   and better approaches are often available.”
 * [@schlessera](https://profiles.wordpress.org/schlessera/) : “It’s a procedural
   pattern that quickly breaks down once you go past procedural code, even in PHP.”

**Takeaways:**

There’s some general consensus that the pattern is not a good fit for how Gutenberg
has been architected, and it’s assumed that this will apply as generally true for
core features written in a similarly JavaScript-oriented approach.

It’s also true that there is usage of JavaScript hooks within Gutenberg for which
a better alternative has surfaced. Thus, they will likely remain a tool, albeit 
one we should consider to avoid as much as possible, and limit exposure and advocation.

**Action Items:**

Consider a communication plan for the role of hooks (future agenda item).

[#javascript](https://make.wordpress.org/core/tag/javascript/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2018/11/07/javascript-chat-summary-november-6th/?share=linkedin)

# Post navigation

[← Dev Chat Agenda: November 7th (5.0 Week 6)](https://make.wordpress.org/core/2018/11/07/dev-chat-agenda-november-7th-5-0-week-6/)

[Dev Chat Summary: November 7th (5.0 Week 6) →](https://make.wordpress.org/core/2018/11/08/dev-chat-summary-november-7th-5-0-week-6/)