Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

polymer-analyzer is reporting that stylesheet imports are lazy. intentional? #1559

Open usergenic opened 7 years ago

usergenic commented 7 years ago

According to https://github.com/Polymer/polymer-analyzer/blob/master/src/html/html-style-scanner.ts#L54 we mark all html stylesheet links as "lazy" imports.

What is intended by this? Anywhere we care about the non-lazy html import graph and the related assets like css+js, I filter imports based on !lazy to exclude lazy-import type html imports, but maybe I have to be more specific now to only care about filter((i) => !(type==='html-import' && lazy===true)?

I found this when I getFeatures all imports and inspect their lazy property. Investigating as part of fix for https://github.com/Polymer/polymer-cli/issues/749

usergenic commented 7 years ago
  /**
   * If true, the imported document may not be loaded until well after the
   * containing document has been evaluated, and indeed may never load.
   */

^ https://github.com/Polymer/polymer-analyzer/blob/master/src/model/import.ts#L54

rictic commented 7 years ago

Hm, this seems like a mistake/bug to me. The stylesheet unconditionally loads when its containing document loads.

I think it should not be lazy.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.