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

Add script to generate inline Fizz runtime #25481

Merged
merged 3 commits into from
Oct 15, 2022

Commits on Oct 14, 2022

  1. Move Fizz inline instructions to unified module

    Instead of a separate module per instruction, this exports all of them
    from a unified module.
    
    In the next step, I'll add a script to generate this new module.
    acdlite committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    38425ba View commit details
    Browse the repository at this point in the history
  2. Add script to generate inline Fizz runtime

    This adds a script to generate the inline Fizz runtime. Previously, the
    runtime source was in an inline comment, and a compiled version of the
    instructions were hardcoded as strings into the Fizz implementation,
    where they are injected into the HTML stream.
    
    I've moved the source for the instructions to a regular JavaScript
    module. A script compiles the instructions with Closure, then generates
    another module that exports the compiled instructions as strings.
    
    Then the Fizz runtime imports the instructions from the
    generated module.
    
    To build the instructions, run:
      yarn generate-inline-fizz-runtime
    
    In the next step, I'll add a CI check to verify that the generated files
    are up to date.
    acdlite committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    e128798 View commit details
    Browse the repository at this point in the history
  3. Check in CI if generated Fizz runtime is in sync

    The generated Fizz runtime is checked into source. In CI, we'll ensure
    it stays in sync by running the script and confirming nothing changed.
    acdlite committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    c9640b9 View commit details
    Browse the repository at this point in the history