Skip to content
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

Keep app dir #2062

Merged
merged 22 commits into from
Sep 1, 2024
Merged

Keep app dir #2062

merged 22 commits into from
Sep 1, 2024

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Aug 9, 2024

This is the last major step before removing app rewriting.

@ef4 ef4 added the enhancement New feature or request label Aug 9, 2024
'entrypoint',
request,
request.virtualize(resolve(pkg.root, matched?.[0] ?? '-embroider-entrypoint.js'))
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a first attempt at fixing the way the entrypoint works, since it may need to crawl a different directory than the package root, given what's in package.json exports.

But this is not really sufficient by itself. The AppFiles class assumes that app and tests have already been smashed together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting the entrypoint inside a path that is mapped via package.json exports seems like a good idea, so this code is probably helpful. It ensures that we're resolving things that are actually supposed to be resolvable from outside the package. But we can't use only this path to identify which dirs to crawl when building the entrypoint, since there is more than one dir to crawl.

Instead, it probably makes sense to make the crawling code attempt to apply resolve.exports to the-package/tests/example and the-package/example to identify the two directories we need to crawl to build AppFiles.

// don't support package.json `exports`. As for a future v2 engine or app:
// this whole method is only relevant for implementing packageRules, which
// should only be for classic stuff. v2 packages should do the right
// things from the beginning and not need packageRules about themselves.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was claiming we don't care about making this code work in native v2 packages, but it honestly seems easier to just make it work than guarantee that nobody will try to ever use reverseComponentLookup in a v2 package.

@ef4 ef4 marked this pull request as ready for review September 1, 2024 20:22
@ef4 ef4 merged commit eb93cd5 into main Sep 1, 2024
188 checks passed
@ef4 ef4 deleted the keep-app-dir branch September 1, 2024 22:54
@github-actions github-actions bot mentioned this pull request Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants