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

fix: properly resolve lasso manifest in hydrate output #2395

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

DylanPiercey
Copy link
Contributor

Description

lasso-marko uses regular path.resolve instead of a require.resolve when processing the dependencies provided from the Marko compiler (https://github.com/lasso-js/lasso-marko/blob/9d4a2f7c190167e5bc3ab1015de54b14163e21b6/lasso-marko-plugin.js#L273).

In the hydrate compilation Marko tries to shorten all import paths to trim off node_modules, eg ./node_modules/@ebay/ebayui-core/thing gets shortened to @ebay/ebayui-core/thing with the assumption it will be resolved later. However lasso-marko was not resolving this, so this PR changes it such that the dependencies provided to lasso are the full (relative) posix path.

Checklist:

  • I have read the CONTRIBUTING document and have signed (or will sign) the CLA.
  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 899a26e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@marko/translator-default Patch
@marko/compiler Patch
marko Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@DylanPiercey DylanPiercey merged commit 00cc3fb into main Dec 5, 2024
7 checks passed
@DylanPiercey DylanPiercey deleted the lasso-marko-fix branch December 5, 2024 16:26
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 44.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 87.89%. Comparing base (329a4ba) to head (899a26e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...es/translator-default/src/util/add-dependencies.js 44.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2395      +/-   ##
==========================================
- Coverage   87.91%   87.89%   -0.03%     
==========================================
  Files         344      344              
  Lines       37955    37971      +16     
  Branches     2385     2385              
==========================================
+ Hits        33367    33373       +6     
- Misses       4564     4574      +10     
  Partials       24       24              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot mentioned this pull request Dec 5, 2024
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