Skip to content

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Sep 24, 2018

Description

Remove the use of glob to require files, simply hard code the necessary files.
This improves performance and simplifies the code.

Fixes #10052

How has this been tested?

Confirmed block library includes still work as expected.

Types of changes

Removes the glob(*) in favor of hard coding.
You can confirm the proper files are included by checking the following directory paths which it was searching to include the files.

> ls -1 ./block-library/**/index.php
ls: cannot access './block-library/**/index.php': No such file or directory

> ls -1 ./packages/block-library/src/**/index.php
./packages/block-library/src/archives/index.php
./packages/block-library/src/block/index.php
./packages/block-library/src/categories/index.php
./packages/block-library/src/latest-comments/index.php
./packages/block-library/src/latest-posts/index.php
./packages/block-library/src/shortcode/index.php

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

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.

2 participants