Conversation
🦋 Changeset detectedLatest commit: d3361a3 The changes in this PR will be included in the next version bump. 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 |
|
So close to finishing this. Looks like Deno isn't happy with importing |
|
This is good to go now. I've updated the PR description for the details. |
natemoo-re
left a comment
There was a problem hiding this comment.
Looks good! Happy to sync on removing some of these post-processing patches and handling most of this in the compiler.
| // TODO: Ideally the compiler could expose a `resolvePath` function so that we can | ||
| // unify how we handle path in a bundler-agnostic way. |
There was a problem hiding this comment.
Yep, this should be possible! Happy to sync on this as a follow-up.
| return false; | ||
| }, | ||
| visitObjectProperty: function (path) { | ||
| // Filter out none 'client:component-path' properties |
There was a problem hiding this comment.
Is this only needed because the compiler doesn't handle these properly yet?
There was a problem hiding this comment.
Yeah. The compiler does handle the client:component-path but not in the way that this PR wants it, so we're postprocessing to have the correct path instead. We should be able to remove this as well when the compiler expose a resolvePath function so that we can resolve to the right one ourselves.
Changes
Avoid usage of
/@fswhen compiling. We still have to embrace a leading slash for Windows as the compiler is resolving paths as URLs, but this will be patched after compiling and invite-plugin-astro-postprocess.Also undo
.jsxstripping by compiler. We try to resolve to.tsxearly during compiling now.Ideally this patch won't be needed when I implement the next steps below.
Supersedes #4829
Next
I'll update
@astrojs/compilerto:resolvePathoption from Astro compiler$$metadata.resolvePath(runtimeastro/internalapi), move all to compile-time..jsxstripping(Appreciate thoughts on the plan too!)
Testing
All existing tests should pass.
Docs
N/A. internal refactor.