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

Invalid import links don't appear in output #71

Closed
tpluscode opened this issue Feb 1, 2017 · 8 comments
Closed

Invalid import links don't appear in output #71

tpluscode opened this issue Feb 1, 2017 · 8 comments
Assignees

Comments

@tpluscode
Copy link
Contributor

Related to #57, I see that v0.1.12-beta.1 shows warning when an import is invalid but it also doesn't put those imports in the JS output.

For example, when I have import 'link!../../polymer/polymer.html'; in a processed file, it gives the warning but not <link> in output.

It is obvious that such imports are invalid at build time of element project. I think that twc should fall back to looking in bower_component to see if the path would actually resolve to bower_components/polymer/polymer.html.

Do you think it's also worth observing .bowerrc in case the components folder has a non-default name?

@Buslowicz
Copy link
Owner

Hmm, I could do that, but I was rather thinking of calculating difference between source and output location and modifying every link! and script! path using that diff. What do you think about that solution? Or should I do as you suggested?

@tpluscode
Copy link
Contributor Author

Oh right, I didn't think about that. Definitely a good idea to have links transformed so that they work in output dir, if it's different.

But still I wouldn't remove any links if they are invalid...

@Buslowicz
Copy link
Owner

Not a problem at all :). Thought it was better to not emit invalid imports, but it might actually be unwanted. I will however add a flag, sort of --noEmitInvalidLink, to restore that behavior on demand (but the default will be as you described).

@tpluscode
Copy link
Contributor Author

My thinking is that you can run into trouble when a link would actually be valid but incorrectly classified. Also, absolute HTTP hrefs (cdn?)

And I'd call the flag --stripBrokenLinks or --stripInvalidLinks

@Buslowicz
Copy link
Owner

Non-relative paths (cdns, absolute) are pretty easy to check, relative are much worse due to changing physical position.
I can definitely leave invalid links, but the question is what to do with them? Warnings are fine if they are definitely dead links, but should not appear if they just don't match physical structure in design time.
Any suggestions about that ^^?

@tpluscode
Copy link
Contributor Author

I don't know. Maybe it's safe to assume that links will usually match a physical location relative to source or destination folder?

@Buslowicz
Copy link
Owner

Yea it might be the best thing to do, at least for now. Nevertheless, I will not strip invalid links as you suggested :).

@Buslowicz Buslowicz self-assigned this Feb 5, 2017
@Buslowicz
Copy link
Owner

Fixed in #74.

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

No branches or pull requests

2 participants