I thought I'd fill in the API docs for the one hook. I think I got it all right, but since it's "official" documentation it's worth having a second set of eyes.

CommentFileSizeAuthor
#2 populate_api_file-2833995-2.patch1.34 KBrupl
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rupl created an issue. See original summary.

rupl’s picture

Status: Active » Needs review
FileSize
1.34 KB

Here's the patch

  • rupl committed edccecb on 7.x-1.x
    Issue #2833995 by rupl: Populate API file
    
rupl’s picture

Status: Needs review » Fixed

committing this since it's better to have something and fix it up rather than nothing at all

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rupl’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Assigned: rupl » Unassigned
Status: Closed (fixed) » Active

Bumping for 8.x development.

Anybody’s picture

@rupi still work to be done?

rupl’s picture

The API file seems fairly populated, but TBH I didn't evaluate whether it reflected the current state of the D8+ module.

https://git.drupalcode.org/project/pwa/-/blob/8.x-1.x/pwa.api.php

Anybody’s picture

Priority: Normal » Minor
Status: Active » Needs work

As of #8

Anybody’s picture

Issue tags: +Novice

As of #8

ChristianAdamski’s picture

Currently listed in .api.php:

hook_pwa_cache_urls_alter(&$cacheUrls, CacheableMetadata &$cacheableMetadata) {
hook_pwa_exclude_urls_alter(&$excludeUrls, CacheableMetadata &$cacheableMetadata) {
hook_pwa_cache_urls_assets_alter(&$resources) {
hook_pwa_cache_urls_assets_page_alter(&$resources, $page, $xpath) {
hook_pwa_manifest_alter(&$manifestData) {

Used alter hooks as of 2.x-rc2:

Module:
- pwa_install_path
- pwa_cache_urls_assets_page
- pwa_cache_urls_assets
- pwa_cache_urls
- pwa_exclude_urls
- pwa_replace_placeholders
- pwa_manifest

Missing in .api.php:
- hook_pwa_install_path_alter
- hook_pwa_replace_placeholders_alter

Theme alter hooks:
- pwa_cache_urls_assets_page
- pwa_manifest

ChristianAdamski’s picture

Function definitions:

\Drupal::moduleHandler()->alter('pwa_install_path', $installPath);
$this->moduleHandler->alter('pwa_replace_placeholders', $replace);

Therefor api additions:

function hook_pwa_install_path_alter(&$installPath) {
function hook_pwa_replace_placeholders_alter(&$replace) {

No idea what these do. Also: use TypeHints?

Anybody’s picture

Version: 8.x-1.x-dev » 2.x-dev