10up / wp-scaffold

10up WordPress project scaffold.
MIT License
204 stars 48 forks source link

TenUpToolkit\set_dist_url_path() function referenced but does not exist. #120

Closed PypWalters closed 9 months ago

PypWalters commented 2 years ago

Describe the bug

This function (TenUpToolkit\set_dist_url_path) does not exist in the wp-scaffold code base. We should either add the function or remove the 2 function calls.

Steps to Reproduce

The function is wrapped in a conditional that would most likely not be true in most cases. The function is referenced in these 2 locations:

If you search the codebase for the function you will not find it.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

joesnellpdx commented 2 years ago

@PypWalters

The function exists as part of 10up-toolkit

Can be found here: https://github.com/10up/10up-toolkit/blob/fd8b7ec9c0a4f7c22174608852d9c38dcbe37282/packages/toolkit/config/fast-refresh.php

More info here: https://github.com/10up/10up-toolkit/blob/fd8b7ec9c0a4f7c22174608852d9c38dcbe37282/packages/toolkit/README.md#basic-setup

CC: @nicholasio

nicholasio commented 2 years ago

That's right, this file is created at build time by toolkit and it's what power hot mode reloading/fast refresh. It's only ever loaded when running locally. Toolkit also does not create that file when building for production

PypWalters commented 2 years ago

Ah, that makes sense! Thanks for the info. Maybe we could add some comments around that part of the code to give some context?