-
Notifications
You must be signed in to change notification settings - Fork 513
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
enhance(bcd): Remove use of @mdn/bcd-utils-api
in testing
#10186
base: main
Are you sure you want to change the base?
Conversation
This removes the mitigation placed due to an issue in SWC 1.3.81+ and ts-node <10.9.1
@mdn/bcd-utils-api
in testing@mdn/bcd-utils-api
in testing
This pull request has merge conflicts that must be resolved before it can be merged. |
1 similar comment
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has merge conflicts that must be resolved before it can be merged. |
@queengooborg Can you explain why |
Well, there's one big reason why using BCD directly doesn't work: Yari depended on custom properties provided by BCD-utils transforms! |
I'm not sure I understand. Currently we fetch the data via |
Note to reviewers: because merge conflicts will occur any time that BCD updates, I will fix them right after this is approved.
Summary
This PR removes the use of
@mdn/bcd-utils-api
during testing (and potentially, could also be removed in production), allowing the use of BCD directly.Note: requires BCD v5.5.0+.
Problem
In the past, we used to be able to use
npx install-local
to import BCD for testing purposes. Unfortunately, with the introduction of the@mdn/bcd-utils-api
package, this is no longer possible, making local testing virtually impossible.Solution
Instead of using the middleware, this modifies the code and routers to use BCD directly once again. Both of the new properties that
@mdn/bcd-utils-api
adds can be bypassed:release_date
property is redundant because we already pass in all the browser data, so we can just get the release dates from the browser dataversion_last
property can just be included in BCD's builds (see Add auto-generatedversion_last
property to support statements browser-compat-data#21500), which is far better since other BCD consumers can use the propertyTesting the changes
To test the change, I did the following:
main
)npm run build
in BCDnpx install-local ../browser-compat-data/build
install-local
catches)version_removed
and compared it to the deployed version of MDN for any differences