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

use href to get the full path of the file #4044

Merged
merged 3 commits into from May 7, 2021

Conversation

@void-mAlex
Copy link
Contributor

@void-mAlex void-mAlex commented Apr 11, 2021

fixes #4043

@adamwathan adamwathan force-pushed the tailwindlabs:master branch from c681549 to 23b71a9 Apr 23, 2021
@@ -229,7 +229,7 @@ function trackModified(files) {
for (let file of files) {
if (!file) continue

let pathname = url.parse(file).pathname
let pathname = url.parse(file).href

This comment has been minimized.

@adamwathan

adamwathan Apr 30, 2021
Contributor

Hey! Unfortunately this isn't the correct fix — the href property includes the query string and that's the part we are trying to drop here.

I think the correct fix is going to be something like:

let parsed = url.parse(file)
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')

This comment has been minimized.

@void-mAlex

void-mAlex Apr 30, 2021
Author Contributor

I will try that change and make the appropriate updates to the PR
meanwhile I would like to ask if this is intended to run outside of a node environment. under what circumstances would there ever be a hash/query params. it would really help to understand how I could have caught this use case earlier

This comment has been minimized.

@void-mAlex

void-mAlex Apr 30, 2021
Author Contributor

ok, now the failed tests make more sense
I'll get right on those changes

This comment has been minimized.

@adamwathan

adamwathan May 7, 2021
Contributor

Yeah the only time it happens is in some build tools like Vite that proxy URLs to the file system and add query string information. For example in Vite it might make a request for a Vue file just to get the CSS portion using a path that's sort of like this if I remember correctly:

http://localhost:3000/@/src/App.vue?lang=css

That gets converted to a file name when passed in to PostCSS and the query string is preserved, so we need to chop it off.

@void-mAlex void-mAlex requested a review from adamwathan May 2, 2021
@codecov-commenter
Copy link

@codecov-commenter codecov-commenter commented May 6, 2021

Codecov Report

Merging #4044 (008b32a) into master (8f5903f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4044   +/-   ##
=======================================
  Coverage   70.11%   70.12%           
=======================================
  Files         219      219           
  Lines        5455     5456    +1     
  Branches     1029     1029           
=======================================
+ Hits         3825     3826    +1     
  Misses       1468     1468           
  Partials      162      162           
Impacted Files Coverage Δ
src/jit/lib/setupContext.js 69.62% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f5903f...008b32a. Read the comment docs.

@adamwathan adamwathan merged commit 212bec9 into tailwindlabs:master May 7, 2021
2 checks passed
2 checks passed
@github-actions
build (12.x)
Details
@github-actions
build (14.x)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants