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 consistency with user plugin node modules resolution #692

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Aug 7, 2021

Related Issue

resolves #690

Summary of Changes

  1. Have server resolve middleware "forward" resolved URLs to each resolver (instead of the original URL each time)
  2. Have plugin-node-modules resolve to paths without query strings
  3. Have plugin-standard-css use default ResourceInterface.shouldResolve logic, like most other Greenwood standard resource plugins
  4. Added tests

Created a discussion to go into this with more depth - #691

TODO

  1. Should confirm if this is a regression or not due to consolidate all Greenwood standard plugin usage into one place #520

@thescientist13 thescientist13 added bug Something isn't working Plugins Greenwood Plugins CLI todos labels Aug 7, 2021
@thescientist13 thescientist13 self-assigned this Aug 7, 2021
@thescientist13 thescientist13 changed the title add consistency to CSS node modules resolution add consistency to (CSS) node modules resolution Aug 7, 2021
@thescientist13 thescientist13 changed the title add consistency to (CSS) node modules resolution fix consistency with (CSS) and user plugin node modules resolution Aug 8, 2021
@thescientist13 thescientist13 changed the title fix consistency with (CSS) and user plugin node modules resolution fix consistency with user plugin node modules resolution Aug 8, 2021
@thescientist13
Copy link
Member Author

Ok, so went back to the v0.14.2 release, ran yarn develop and still got a 500

$ git checkout 0.14.2
$ yarn install && yarn lerna bootstrap
$ yarn develop

----

$ curl -Iv "http://127.0.0.1:1984/node_modules/simpledotcss/simple.css"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 1984 (#0)
> HEAD /node_modules/simpledotcss/simple.css HTTP/1.1
> Host: 127.0.0.1:1984
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: text/javascript
Content-Type: text/javascript
< Content-Length: 9493
Content-Length: 9493
< Date: Sun, 08 Aug 2021 00:13:44 GMT
Date: Sun, 08 Aug 2021 00:13:44 GMT
< Connection: keep-alive
Connection: keep-alive
< Keep-Alive: timeout=5
Keep-Alive: timeout=5

<
* Connection #0 to host 127.0.0.1 left intact
* Closing connection 0


-----

% curl -Iv "http://127.0.0.1:1984/node_modules/simpledotcss/simple.css?xyz
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 1984 (#0)
> HEAD /node_modules/simpledotcss/simple.css?xyz=123 HTTP/1.1
> Host: 127.0.0.1:1984
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
Content-Type: text/plain; charset=utf-8
< Content-Length: 21
Content-Length: 21
< Date: Sun, 08 Aug 2021 00:14:41 GMT
Date: Sun, 08 Aug 2021 00:14:41 GMT
< Connection: keep-alive
Connection: keep-alive
< Keep-Alive: timeout=5
Keep-Alive: timeout=5

<
* Connection #0 to host 127.0.0.1 left intact
* Closing connection 0

@thescientist13 thescientist13 force-pushed the bug/issue-690-fix-no-content-returned-node-modules-css-uery-strings branch from b02d22b to 48ca8ae Compare August 11, 2021 15:04
@thescientist13 thescientist13 merged commit 56c0870 into master Aug 11, 2021
@thescientist13 thescientist13 deleted the bug/issue-690-fix-no-content-returned-node-modules-css-uery-strings branch August 11, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI P0 Critical issue that should get addressed ASAP Plugins Greenwood Plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query string parameters in node_modules (CSS) paths returns no content and 204 response
1 participant