From 831b59218d742c6c05da104676146932d7c31787 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Mon, 2 May 2022 21:14:54 -0700 Subject: [PATCH] Deletes `inlineStyleLegacy()`. There is no more need for this since the new `inlineStyle()` function has shipped. --- packages/rules_prerender/BUILD.bazel | 1 - packages/rules_prerender/index.ts | 2 +- packages/rules_prerender/styles.ts | 13 ------------ packages/rules_prerender/styles_test.ts | 20 +------------------ packages/rules_prerender/testdata/BUILD.bazel | 3 --- packages/rules_prerender/testdata/styles.css | 1 - 6 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 packages/rules_prerender/testdata/BUILD.bazel delete mode 100644 packages/rules_prerender/testdata/styles.css diff --git a/packages/rules_prerender/BUILD.bazel b/packages/rules_prerender/BUILD.bazel index b6c9538c..aa14455d 100644 --- a/packages/rules_prerender/BUILD.bazel +++ b/packages/rules_prerender/BUILD.bazel @@ -190,7 +190,6 @@ ts_library( name = "styles_test_lib", srcs = ["styles_test.ts"], testonly = True, - data = ["//packages/rules_prerender/testdata:styles.css"], deps = [ ":inline_style_map", ":styles", diff --git a/packages/rules_prerender/index.ts b/packages/rules_prerender/index.ts index a5d10148..7bfeba3c 100644 --- a/packages/rules_prerender/index.ts +++ b/packages/rules_prerender/index.ts @@ -2,4 +2,4 @@ export { PrerenderResource } from 'rules_prerender/common/models/prerender_resource'; export { includeScript } from 'rules_prerender/packages/rules_prerender/scripts'; -export { includeStyle, inlineStyle, inlineStyleLegacy } from 'rules_prerender/packages/rules_prerender/styles'; +export { includeStyle, inlineStyle } from 'rules_prerender/packages/rules_prerender/styles'; diff --git a/packages/rules_prerender/styles.ts b/packages/rules_prerender/styles.ts index 6f8a3e62..14ef2bff 100644 --- a/packages/rules_prerender/styles.ts +++ b/packages/rules_prerender/styles.ts @@ -69,16 +69,3 @@ export class InlineStyleNotFoundError extends Error { }); } } - -/** - * Reads the given CSS file at the provided runfiles path and returns it in a - * ` - `.trim(); -} diff --git a/packages/rules_prerender/styles_test.ts b/packages/rules_prerender/styles_test.ts index bffd345c..dc36f7ab 100644 --- a/packages/rules_prerender/styles_test.ts +++ b/packages/rules_prerender/styles_test.ts @@ -2,7 +2,7 @@ import 'jasmine'; import * as inlineStyleMap from 'rules_prerender/packages/rules_prerender/inline_style_map'; import { createAnnotation, StyleScope } from 'rules_prerender/common/models/prerender_annotation'; -import { includeStyle, inlineStyle, inlineStyleLegacy, InlineStyleNotFoundError } from 'rules_prerender/packages/rules_prerender/styles'; +import { includeStyle, inlineStyle, InlineStyleNotFoundError } from 'rules_prerender/packages/rules_prerender/styles'; describe('styles', () => { describe('includeStyle()', () => { @@ -58,22 +58,4 @@ describe('styles', () => { })} -->`); }); }); - - describe('inlineStyleLegacy()', () => { - it('resolves to a ` - `.trim()); - }); - - it('rejects when the given file path is not found in runfiles', async () => { - await expectAsync(inlineStyleLegacy('rules_prerender/does/not/exist.css')) - .toBeRejected(); - }); - }); }); diff --git a/packages/rules_prerender/testdata/BUILD.bazel b/packages/rules_prerender/testdata/BUILD.bazel deleted file mode 100644 index bb54df0c..00000000 --- a/packages/rules_prerender/testdata/BUILD.bazel +++ /dev/null @@ -1,3 +0,0 @@ -package(default_visibility = ["//packages/rules_prerender:__pkg__"]) - -exports_files(["styles.css"]) diff --git a/packages/rules_prerender/testdata/styles.css b/packages/rules_prerender/testdata/styles.css deleted file mode 100644 index 2d130df9..00000000 --- a/packages/rules_prerender/testdata/styles.css +++ /dev/null @@ -1 +0,0 @@ -.foo { color: red; }