Skip to content

Refactor path resolve handling#4829

Closed
bluwy wants to merge 4 commits intomainfrom
refactor-path-resolve
Closed

Refactor path resolve handling#4829
bluwy wants to merge 4 commits intomainfrom
refactor-path-resolve

Conversation

@bluwy
Copy link
Copy Markdown
Member

@bluwy bluwy commented Sep 21, 2022

Changes

Avoid /@fs whenever possible. WIP

TODO: Investigate windows css link failures

Testing

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 21, 2022

⚠️ No Changeset found

Latest commit: ec3f4af

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 21, 2022
@bluwy
Copy link
Copy Markdown
Member Author

bluwy commented Sep 22, 2022

Spun up my 'ol windows laptop today and I'm starting to understand why all this happens now. The Astro compiler is treating client:only and hydrated components path all as URLs, which they aren't as they are Vite/Rollup import path specifiers.

E.g. passing pathname, the transformResult.clientOnlyComponents and hydratedComponents's [<num>].resolvedPath derives from pathname. That means we're dealing with URLs instead (import specifier -> URL)

But then when building, we analyze the Rollup bundle output to link these, but the output are all raw fs paths. Comparing them against clientOnlyComponents for example becomes tricky (fs path -> URL).

I might have to re-think tomorrow on a more general fix to this. (^Jotting down notes)

@matthewp
Copy link
Copy Markdown
Contributor

Thanks for doing the research to understand why the problem exists! This was the most important part of this task. The more we can wait to resolve until later the better it will be.

@bluwy
Copy link
Copy Markdown
Member Author

bluwy commented Sep 27, 2022

Closing this one for now. Will open a new one with a different strategy.

@bluwy bluwy closed this Sep 27, 2022
@bluwy bluwy deleted the refactor-path-resolve branch September 29, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants