Skip to content
Permalink
Browse files

Web UI: Update styleguide to discourage grit includes

See https://docs.google.com/document/d/1Z18WTNv28z5FW3smNEm_GtsfVD2IL-CmmAikwjw3ryo/edit?usp=sharing#heading=h.66ycuu6hfi9n

Bug: None
Change-Id: I6b666f7531c1a68a2a7ab3ba13b11f8b061ef0b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954343
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722195}
  • Loading branch information
rbpotter Commit Bot
rbpotter authored and Commit Bot committed Dec 5, 2019
1 parent ebd856e commit 6068a2839c9ce8b052e84a6e27bb634a7aef0dd8
Showing with 4 additions and 9 deletions.
  1. +4 −9 styleguide/web/web.md
@@ -460,15 +460,10 @@ function isWindows() {
```

`<include src="[path]">` reads the file at `path` and replaces the `<include>`
tag with the file contents of `[path]`.

Don't use `</include>` to close these tags; they're not needed nor supported.

<div class="note">
Using <code>&lt;include&gt;</code> simply pastes the entire contents of a file,
which can lead to duplication. If you simply want to ensure some code is loaded
(and usually you do), you should use HTML Imports instead.
</div>
tag with the file contents of `[path]`. Don't use `<include>` in new JS code;
[it is being removed.](https://docs.google.com/document/d/1Z18WTNv28z5FW3smNEm_GtsfVD2IL-CmmAikwjw3ryo/edit?usp=sharing#heading=h.66ycuu6hfi9n)
Instead, use JS imports in new pages and pages that use JS modules. Use HTML
imports in existing pages that are still using HTML imports/Polymer 2.

Grit can read and inline resources when enabled via `flattenhtml="true"`.

0 comments on commit 6068a28

Please sign in to comment.
You can’t perform that action at this time.