Skip to content

0.0.32

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 24 Jul 02:56

BREAKING CHANGES

  • a1962af - The bundle_js flag has been removed. Client-side JavaScript is always bundled and does not throw an error if there are no scripts to bundle. Even if a page does not use JavaScript today, a component may add JavaScript in the future, and these scripts would not be enabled on any page with bundle_js = False. As a result, it is best to always bundle client-side scripts. If a page happens to not have any, this is not considered an error or antipattern.

Changelog

  • 18a8811 - prerender_pages no longer throws an error if there are no scripts to bundle. It now passes without error and injects no JavaScript files into the prerendered HTML.
  • 62f2eab - prerender_pages no longer emits a warning if a script is empty. This happens when an HTML page includes a single includeScript of an empty file. If a script is empty, it will not be output by the bundling process and will not be injected into the page as a performance optimziation.

Installation

Copy the following into your WORKSPACE.bazel file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_rules_js",
    sha256 = "00e7b97b696af63812df0ca9e9dbd18579f3edd3ab9a56f227238b8405e4051c",
    strip_prefix = "rules_js-1.23.0",
    url = "https://github.com/aspect-build/rules_js/releases/download/v1.23.0/rules_js-v1.23.0.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()

load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "nodejs",
    node_version = "18.12.1",
)

load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock")
npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
    npmrc = "//:.npmrc",
)
load("@npm//:repositories.bzl", "npm_repositories")
npm_repositories()

load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
register_jq_toolchains()

# This _must_ be named `rules_prerender`, other names are currently unsupported.
http_archive(
    name = "rules_prerender",
    sha256 = "36434a83e0b71b4fca0363b5ae50cc7c6878fe394c9900a03c3613ce15c6a538",
    strip_prefix = "rules_prerender-0.0.32",
    url = "https://github.com/dgp1130/rules_prerender/releases/download/releases%2F0.0.32/rules_prerender-bazel_workspace-0.0.32.tar.gz",
)
load("@rules_prerender//:dependencies.bzl", "rules_prerender_dependencies")
rules_prerender_dependencies()
load("@rules_prerender//:repositories.bzl", "rules_prerender_repositories")
rules_prerender_repositories()
load(
    "@rules_prerender//:npm_repositories.bzl",
    prerender_npm_repositories = "npm_repositories",
)
prerender_npm_repositories()