Conversation
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.
Thanks @danielbitzer ! This is testing well and code looks good, including changes to READMEs. I found no instances of "lib/tracks" in the codebase too.
After a few ongoing PRs get merged, we can publish packages soon including this one.
cf42c97
to
8c79fd4
Compare
Thanks for the review @psealock!
Cool! Can you let me know when the package is published so I can P2 and we can start using it? |
Really great addition @danielbitzer - thanks for making this happen. |
Awesome! |
Great work @danielbitzer 👏 |
Now that WooCommerce Admin is included in core, do we need to publish this as a package? Maybe I'm missing something .. In my current Woo install, I don't have WooCommerce Admin installed, and If there's added value (e.g. util functions) in wc-admin that's useful, maybe it needs to be exposed as part of core. |
@haszari WC Admin's
|
Aha, thanks for clarifying @danielbitzer ! Note the main reason I'm asking these questions is to better understand if we should use
Agreed, that makes sense.
Is this going to be available as part of core in future? Definitely seems useful!
I was wondering if util code was a motivator here. I'm curious whether this could be included in core or whether it's better to make available as a package.
Assuming the code is the same, is it redundant/extra bytes to consume via package when it's on a global? Or, put another way, should we remove the global in favour of using the package? I agree a package makes it easier to get the latest APIs/code (i.e. known version) so that's an advantage. |
This and the idea that we can iterate on things in an external package prior to merging into core I believe are the main reasons for keeping it under the namespaced There are more features we can add in here for queuing prior to navigation so that we're not missing tracks due to race conditions.
Someone can correct me if I'm wrong, but I think the answer is "yes." The current model seems to be:
I'd be in favor of this, but I imagine some legacy code would need to be cleaned up first. I'm not sure if the consuming scripts in core are capable of using ES6 imports or not yet. |
Fixes #5016
Moves the functions from
lib/tracks
to a@woocommerce/tracks
package so other Automattic extensions can use them.Detailed test instructions:
Changelog Note:
Dev - Added
@woocommerce/tracks
packagecc: @jconroy