-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Use "exports" field in package.json #13359
Comments
The |
Support for pattern trailers was added in Node 14.19.0 and 16.9.0. If we wanted to move forward with this, we'd have to upgrade our
The latest 14.x is 14.19.1 and the latest 16.x is 16.14.2. It seems reasonable to bump our required versions to these, but... Node 15 didn't receive a backport because it isn't an LTS (does that mean we don't support it?). And IDK about 17 because it isn't listed in the changelog but various references in the issue say 17.0.0 should have it... |
yea we don't officially support non LTS (15) |
We decided not to do this, and just have the changes from renaming folders be fully breaking. It only affects Node users and the fixes are all trivial. |
We first tried to introduce this via #13349 for the v9 release. The idea was to define the exports in a non-breaking way, such that all modules under
./lighthouse-core/*
/./lighthouse-cli/*
/./types/*
would be exposed + a new export for the renderer api at./renderer
. However, we quickly found that clients (specifically pubads, but if you search GitHb there are tons) tend to import modules with and without a.js
extension.Defining exports like this seemed like it would support optional extension in the import. The first entry that matches the key is used, and the
*
matches as much as the pattern as possible (includes slashes).However,
yarn build-devtools
(exercising the pubads code) still failed to resolve all its imports. As this seemed like a huge blocker to adoption for this feature, I began to write a bug report, but first I found these issues in the nodejs project:nodejs/node#39635
Turns out, "pattern trailers" was an overlooked feature. It was recently added AND backported to 14.
nodejs/Release#690 (comment)
It should land in the next releases across 14+, but IDK when that is. (Ex:
14.18.2 will have the fix, but the latest is 14.18.1. ditto for 17.1.1see #13359 (comment)). But, it won't be in time for v9.I can't test it yet, but I believe this will work:
(note the order is swapped from the original intuition. not sure why, I'm just copying from the example in the PR)
The text was updated successfully, but these errors were encountered: