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
linter should warn if path reaching back from the lib to the web folder #18589
Comments
normally Pub packages don't allow importing "web" from "lib" ... because anyone depending on the pkg won't see the "web". However, it sounds like the error message isn't as clear as it could be. |
regarding:
John reminded me of a very good point: reaching out from lib/ to web/ is not good because if anyone wants to depend on your code in 'lib/' it wont work for them. If code is not meant to be shared, then all the code can be put under web/, but if stuff is in lib/, it should only import things in lib and in other packages. We should report a warning if you are reaching out of your package, but also avoid making the build fail as much as possible. |
oops, I didn't notice John already replied about this when I hit send. Sorry for the spam |
Added this to the 1.5 milestone. |
Added Pkg-Polymer label. |
Removed Pkg-Polymer label. |
Removed Library-PolymerBuild label. |
Removed Area-Polymer label. |
Changed the title to: "linter should warn if path reaching back from the lib to the web folder". |
Removed Priority-Unassigned label. |
Removed Priority-Medium label. |
Removed this from the 1.6 milestone. |
Removed Polymer-P-1 label. |
Added PolymerMilestone-Next label. |
Removed Polymer-Milestone-Next label. |
This issue has been moved to dart-archive/polymer-dart#392. |
Consider this scenario
Today the URL cannot be written in a way that makes sense. It works if you do:
"../../web/css/bar.css"
That is because our resolution assumes that a.html is inside package 'p', but it doesn't recognize that a path that reaches above "packages/" is back at the folder of the entrypoint file. A more reasonable path would be "../../css/bar.css".
I'm not sure if this should be allowed, or if we should treat ".../packages/" as a way of entering in the package domain only (like when you enter from a file:/ url into a package:/ url).
Long term, we should also support paths that start with "/" like "/packages/foo/css/bar" so people can put their shared assets under the lib/ folder.
The text was updated successfully, but these errors were encountered: