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

feat(ui5-tooling-modules): new module resolution #1087

Merged
merged 10 commits into from
Oct 5, 2024

Conversation

petermuessig
Copy link
Member

@petermuessig petermuessig commented Oct 4, 2024

The new module resolution utilizes the Node.js resolution algorithm. Especially, the handling of the entry points: https://nodejs.org/api/packages.html#package-entry-points and the mapping defined in the browser field in the package.json ensures a consistent bundling experience.

The module resolution has been centralized in the resolveModule function. This is the central place which ensures a consistent module resolution for all places in the ui5-tooling-modules script.

In addition, the feature implements several caches to avoid unnecessary expensive lookups.

@petermuessig petermuessig changed the title Feat/modules resolve browser feat(ui5-tooling-modules): new module resolution Oct 4, 2024
@petermuessig petermuessig marked this pull request as ready for review October 5, 2024 15:57
@petermuessig petermuessig merged commit 2e6c50c into main Oct 5, 2024
5 checks passed
@petermuessig petermuessig deleted the feat/ModulesResolveBrowser branch October 5, 2024 15:58
marianfoo pushed a commit that referenced this pull request Nov 5, 2024
* fix(ui5-tooling-modules): properly resolve and match modules in the bundle

* feat(ui5-tooling-modules): support browser object for dependencies in package.json

* fix(ui5-tooling-modules): avoid lookup when nod node_modules found

* feat(ui5-tooling-modules): new module resolution

* feat(ui5-tooling-modules): consider package.json mappings

* fix(ui5-tooling-modules): fix existsSyncWithCase on Windows

* fix(ui5-tooling-modules): performance improvements

* fix(ui5-tooling-modules): windows compatibility of caches

* fix(ui5-tooling-modules): support linked projects for require.resolve

* fix(ui5-tooling-modules): only include depPaths of linked projects

---

The new module resolution utilizes the Node.js resolution algorithm. Especially, the handling of the entry points: https://nodejs.org/api/packages.html#package-entry-points and the mapping defined in the browser field in the `package.json` ensures a consistent bundling experience. 

The module resolution has been centralized in the `resolveModule` function. This is the central place which ensures a consistent module resolution for all places in the `ui5-tooling-modules` script.

In addition, the feature implements several caches to avoid unnecessary expensive lookups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant