-
Notifications
You must be signed in to change notification settings - Fork 74
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
Windows #3
Windows #3
Changes from 4 commits
fe07092
db94dbb
d7ed40d
51b6d84
716c7eb
0244151
54f1a15
e954b8b
c24680c
acf955c
ad5d6f1
fc52fd2
d3b8eed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,7 +8,7 @@ import { | |||||||||||
} from "h3"; | ||||||||||||
import { createNitro } from "nitropack"; | ||||||||||||
|
||||||||||||
import { join } from "node:path"; | ||||||||||||
import { join } from "pathe"; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here as in build.js. Characters being escaped because of vinxi/packages/vinxi/lib/dev-server.js Lines 156 to 160 in 505dd51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the very least it should not cause problems for linux since From a quick test it looks like as long things go through vite/rollup it's fine to import with import test from "C:/Users/Davide/Desktop/wpath/w/dep.js" Node: ❌ not supported import test from "C:\\Users\\Davide\\Desktop\\wpath\\w\\dep.js" Node: ❌ not supported import test from "file:///C:/Users/Davide/Desktop/wpath/w/dep.js" Node: ✔️ import test from "/Users/Davide/Desktop/wpath/w/dep.js"
import test from "/C:/Users/Davide/Desktop/wpath/w/dep.js" Node: ✔️ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you have tested these changes on windows? and they are all working good? is there anything else that's not working on windows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH my brain hurts when I try to decipher this windows/linux path differences, I never know what to do so this a big saving grace for me if you have got it all working There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's honestly quite difficult to tell if everything actually works. I am fighting with a lot of inconsistency. Primarily used the tests here and the bare example on the solid-start/vinxi branch. The example on the solid-start repo is not reliable as it had other issues unrelated to vinxi. If there is anything specific you want me to run on my machine let me know. Windows 3 failed
[chromium] › basic-dev.test.ts:40:3 › basic dev › api ==========================================
[chromium] › basic-prod.test.ts:40:3 › basic build › api =======================================
[chromium] › hmr.test.ts:81:3 › hmr › hmr api ==================================================
6 passed (39s) Linux One test just randomly fails if I run it enough times. It also looks like it's not releasing the ports? 1) [chromium] › hmr.test.ts:81:3 › hmr › hmr api =================================================
Error: expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 7
- Hello world
+ <!DOCTYPE html><html lang="en"><head><link rel="icon" href="/favicon.ico"/><!--$--><script type="module">
+ import RefreshRuntime from "/_build/@react-refresh"
+ RefreshRuntime.injectIntoGlobalHook(window)
+ window.$RefreshReg$ = () => {}
+ window.$RefreshSig$ = () => (type) => type
+ window.__vite_plugin_react_preamble_installed__ = true
+ </script><script type="module" src="/_build/@vite/client"></script><!--/$--></head><body><section><h1 data-test-id="content">Hello from Vinxi</h1><div><button data-test-id="button">Click me</button><span data-test-id="count">0</span></div></section></body></html><script>window.manifest = {}</script><script type="module" src="/_build/@fs/workspaces/vinxi/test/.fixtures/hmr-dupkt25h3h8/app/entry-client.tsx" async=""></script>
83 | prettyHtml(`<h1 data-test-id="content">Hello from Vinxi too</h1>`),
84 | );
> 85 | });
| ^
86 |
87 | test("client hmr", async ({ page }) => {
88 | let app = new PlaywrightFixture(appFixture, page);
at file:///workspaces/vinxi/test/hmr.test.ts:85:30
1 failed
[chromium] › hmr.test.ts:81:3 › hmr › hmr api ==================================================
8 passed (35s) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will take a look a it again later today with a fresh mind.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah man you are doing amazing work here. This is the biggest overall issue here.. the differences between the OSes when it comes to paths. I can get on a google meet if you want to chat the issues. (my discord username is nksaraf if you want to get in touch there) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the offer, I am on the solidjs discord as Btw the two failed tests are the glob/micromatch failing the
Not elaborating further is great... 🤣 After that, it's just the hmr issue that's left. It's a bit of a weird one. Last time I checked file creation was being picked up but not the edits in some cases. |
||||||||||||
import { fileURLToPath } from "node:url"; | ||||||||||||
import { isMainThread } from "node:worker_threads"; | ||||||||||||
|
||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"use strict"; | ||
|
||
import { isBuiltin } from "node:module"; | ||
import { join, resolve } from "node:path"; | ||
import { join, resolve } from "pathe"; | ||
|
||
async function getViteModuleNode(vite, file, ssr) { | ||
if (file.startsWith("node:") || isBuiltin(file)) { | ||
|
@@ -19,7 +19,7 @@ async function getViteModuleNode(vite, file, ssr) { | |
|
||
const id = resolvedId.id; | ||
|
||
const normalizedPath = resolve(id).replace(/\\/g, "/"); | ||
const normalizedPath = resolve(id); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
try { | ||
let node = await vite.moduleGraph.getModuleById(normalizedPath); | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -51,7 +51,7 @@ export function createDevManifest(app) { | |||||||
} else { | ||||||||
return { | ||||||||
output: { | ||||||||
path: absolutePath, | ||||||||
path: join(router.base, "@fs", absolutePath), | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change will not in some modes: this change will not work, on the server we don't want to use @fs links. those are for the client. this is being used with the server actions setup. I should add a test for that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nksaraf What about LN 175? Should that also be reverted in that case? I did this in two places.
|
||||||||
}, | ||||||||
}; | ||||||||
} | ||||||||
|
@@ -173,7 +173,7 @@ export function createDevManifest(app) { | |||||||
]; | ||||||||
}, | ||||||||
output: { | ||||||||
path: absolutePath, | ||||||||
path: join(router.base, "@fs", absolutePath), | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure on this one but seems to work. If I remember it right dynamic import in lazy route would not work. vinxi/packages/vinxi-solid/lazy-route.jsx Lines 20 to 22 in 505dd51
|
||||||||
}, | ||||||||
}; | ||||||||
} | ||||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||
import { relative } from "node:path"; | ||||
import { relative } from "pathe"; | ||||
import { fileURLToPath } from "node:url"; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Manifest lookups in build would fail because of
|
||||
|
||||
export function routes() { | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports would fail because of characters being escaped generating paths like
C:goodjobwindows
vinxi/packages/vinxi/lib/build.js
Lines 457 to 460 in 505dd51