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: double modules hazard by preferring relative paths #645

Merged
merged 30 commits into from
Apr 10, 2024

Conversation

Aslemammad
Copy link
Contributor

@Aslemammad Aslemammad commented Apr 1, 2024

close #631

Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Apr 10, 2024 2:18am

Copy link

codesandbox-ci bot commented Apr 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we are almost there!

packages/waku/src/lib/renderers/dev-worker-impl.ts Outdated Show resolved Hide resolved
packages/waku/src/lib/renderers/dev-worker-impl.ts Outdated Show resolved Hide resolved
packages/waku/src/lib/renderers/dev-worker-impl.ts Outdated Show resolved Hide resolved
packages/waku/src/lib/renderers/html-renderer.ts Outdated Show resolved Hide resolved
packages/waku/src/lib/renderers/html-renderer.ts Outdated Show resolved Hide resolved
@dai-shi dai-shi changed the base branch from issue-631 to main April 9, 2024 13:46
Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost.

@@ -165,23 +165,21 @@ export const devServer: Middleware = (options) => {
vitePromise,
]);

if (!initialModules) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason behind this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related with #601?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea just removed it because it was not needed, not any other reason. And it worked this way.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

651f04c reverted this. let's tackle it as #601 separately. feel free to submit a new PR, hopefully with a test case (e2e or an example).

Comment on lines 265 to 280
const file = (
filePath.slice(config.basePath.length).startsWith('@fs/')
? filePath.slice((config.basePath + '@fs').length)
: filePath
).split('?')[0]!;
const wakuDist = joinPath(
fileURLToFilePath(import.meta.url),
'../../..',
);
if (file.startsWith(wakuDist)) {
const fileWithAbsolutePath =
!file.startsWith(opts.rootDir) && !file.startsWith(wakuDist)
? encodeFilePathToAbsolute(joinPath(opts.rootDir, file))
: file;
if (
file.startsWith(wakuDist) ||
fileWithAbsolutePath.startsWith(wakuDist)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part looks a little bit complicated and has room for improvement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes /user/project/src/comp.tsx into /src/comp.tsx

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but this entire block can be refactored for more readability, no?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think we can remove L279.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think we can remove L279.

5e1ae0d

@dai-shi dai-shi mentioned this pull request Apr 9, 2024
Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be good.

@dai-shi dai-shi merged commit 95c4be6 into dai-shi:main Apr 10, 2024
28 checks passed
@Aslemammad
Copy link
Contributor Author

Everything's passing, congrats!

@Aslemammad Aslemammad deleted the fix/issue-631 branch April 10, 2024 03:03
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.

[BUG] Context Provider invalid value
2 participants