-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework: Replace all usage of wp-scripts env
with @wordpress/env
.
#17871
Conversation
93f11e0
to
4a87158
Compare
Can we keep |
Ideally, we do find a way to lazy-load @wordpress/scripts dependencies. It's not specific to the "env" command though. Parcel does that a lot, I think we should take some inspiration from them and see how they do it. |
4a87158
to
0caa67e
Compare
I dropped the commit that removed it.
They have separate packages that are required dynamically by looking at the dependencies in So what we can do is break down each script into a separate package, then have the core of
|
I'd love to not see Lazyloading just even this would make me quite happy ;) |
I think a message is fine. This is how we replaced
|
I'm confused—why do we now need |
@@ -195,13 +195,13 @@ | |||
"dev:packages": "node ./bin/packages/watch.js", | |||
"docs:build": "node ./docs/tool/index.js && node ./bin/update-readmes.js", | |||
"fixtures:clean": "rimraf \"packages/e2e-tests/fixtures/blocks/*.+(json|serialized.html)\"", | |||
"fixtures:server-registered": "wp-scripts env docker-run php ./bin/get-server-blocks.php > test/integration/full-content/server-registered.json", | |||
"fixtures:server-registered": "npm run env run tests-wordpress-phpunit './bin/get-server-blocks.php > test/integration/full-content/server-registered.json'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should run this script with PHP, it doesn't use PHPUnit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but tests-wordpress-phpunit
has php
and we already use it.
See #15667. The issue is on the |
@gziolo I think we should do like parcel:
This won't solve the issue for Gutenberg because we use all the dependencies but it's important for Plugin/Theme authors if they only use wp-scripts for bundling for instance. |
Does it mean we can't match any of the commands so people don't have to install We definitely should remove the old approach. We don't want to maintain two completely different environments. |
I love the idea, filed in #17987. |
To bootstrap the Core PHP unit test framework unfortunately.
They don't line up 1-1. I'm a bit torn now on whether we should use It's a tradeoff between making this tool faster for plugin/theme developers and making it work for people who want to work on both codebases at once. Thoughts @youknowriad ? |
I see. Is it that previously we were cloning
Could it be a flag? Something like |
Yeah.
Yes, it could be, and I guess we wouldn't need any more dependencies for it. Should we go down that route? cc @youknowriad |
How big is the performance gap between both approaches?
I'm fine with that. I'd personally prefer to have the least possible number of options, so being opinionated is better. If we can't manage to have both "fast" and "allow php unit testing" at the same time we can add that option. |
Pretty significant. You have to install all of I'm closing this and adding the new approach to the task list: #17724. It'd be great if we could get the two pending PRs merged to avoid conflicts as we work on this. @youknowriad |
Follows #17724
Description
This PR replaces all usage of
wp-scripts env
with@wordpress/env
.How has this been tested?
It was verified that all changed commands, including E2E testing and PHP linting still work as expected. The Travis usage also indirectly helped with this.
Types of Changes
Breaking Change: The new
env
family of scripts has been removed (#17004), use@wordpress/env
instead.Checklist: