Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Use xhp for html rendering #27

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Commits on May 27, 2023

  1. Remove HH_FIXME for ENT_HTML5

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    9415eeb View commit details
    Browse the repository at this point in the history
  2. Require xhp-lib

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    572bf9d View commit details
    Browse the repository at this point in the history
  3. Format the affect files

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    e625dd9 View commit details
    Browse the repository at this point in the history
  4. Shift hhast into top gear

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    94aac71 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8d8282b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8134e9d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    dccc276 View commit details
    Browse the repository at this point in the history
  8. Disable FinalOrAbstractClassLinter

    This library contain many non-final classes, all of which may have been extended elsewhere.
    Accept that this library doesn't meet this strict standard and move on.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    799edc0 View commit details
    Browse the repository at this point in the history
  9. Disable UseStatementWithAsLinter

    This library contains classes with duplicate names.
    Example:
    ```
    use type Facebook\Markdown\Block\ThematicBreak as ASTNode;
    class ThematicBreak {}
    ```
    The alias to ASTNode allows the UnparsedBlocks\ThematicBreak to refer to the other.
    A use statement without an alias would create a name collision with the declaration.
    One could choose to always refer to the other node using a qualified name:
    Blocks\ThematicBreak
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    32a5de5 View commit details
    Browse the repository at this point in the history
  10. Lint NoEmptyStatementsLinter

    This linter found `$offset;`, but I can't imagine what this was supposed to do.
    It's an int, so what the intent to increment / decrement it?
    Thank you @ryangreenberg for adding this linter to hhast.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    228532a View commit details
    Browse the repository at this point in the history
  11. Lint clean with "all"

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    9ff4e8c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0bf465f View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    cbc51f9 View commit details
    Browse the repository at this point in the history
  14. Prepare for boolean attributes in tests

    XHP renders `disabled={true}` as `disabled`, but the spec expects `disabled=""`.
    It would be a shame if this small incompatibility would block xhp adoption.
    Let's make the spec tests allow these stringless boolean attributes.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    b02c8d9 View commit details
    Browse the repository at this point in the history
  15. Introduce an escape hatch for XHP rendering

    The HTMLXHPRenderer still needs to be written.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    c8fdbdd View commit details
    Browse the repository at this point in the history
  16. Create covariant interface IRenderer<T>

    All methods have been extracted from Renderer<T>.
    We need this interface to write tests again HTML(XHP)?Renderer.
    This itnerface allows us to reference them as `IRenderer<XHPChild>`.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    b5e961a View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    82ba6dd View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    728a277 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    c5f3fd4 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    30979eb View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    19916da View commit details
    Browse the repository at this point in the history
  22. Emit images with xhp

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    1e5646d View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    8a5c5b4 View commit details
    Browse the repository at this point in the history
  24. Render lists with XHP

    Requires disabling child validation.
    Some of the specs expect invalid html.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    666c388 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    b60ab93 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    c6a0f40 View commit details
    Browse the repository at this point in the history
  27. Remove FORCE_RENDER

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    63148c2 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    9482d13 View commit details
    Browse the repository at this point in the history
  29. Factor out escape_uri_attribute

    One fewer "magic" type system lie!
    Explicitly use the `->forceAttribute()` api.
    This is the proper way to tell lies and will be caught when xhp attributes become sound.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    6b25e2c View commit details
    Browse the repository at this point in the history
  30. Wrap the HTMLXHPRenderer in a Renderer<string>

    We can't simply switch the HTMLRender to use HTMLXHPRenderer under the hood.
    The xhp renderer has slightly different output:
     - Boolean attributes are rendered as `attr` instead of `attr=""`.
     - Void elements don't include a trailing solidus (backslash) in their open tag.
    I'd not want to break test suites , bust caches, or break naive parsers.
    This change should be opt-in, but low friction.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    fb18394 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    69b6b88 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    86ec5dc View commit details
    Browse the repository at this point in the history
  33. Optimization found by HHClientLinter

    HTMLXHPRenderer had a `$node !== ''` comparison.
    This is always false, but we don't case about the filter anyhow.
    Joining an empty string has the same effect as not joining it.
    Optimization also applied in HTMLRenderer.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    999f859 View commit details
    Browse the repository at this point in the history
  34. Remove needless xhp_join() calls

    Wrapping a vec of nodes in a frag is not needed if embedded in a node.
    The node would unpack the frag immediately and appended the children.
    This is what it does for a vec too.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    c096490 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    c53319a View commit details
    Browse the repository at this point in the history
  36. Remove hhvm(-autoload) requirement

    The hhvm version is laughably out of date.
    We don't need hhvm-autoload, HH\Facts will do.
    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    4a55838 View commit details
    Browse the repository at this point in the history
  37. Fix CI

    lexidor committed May 27, 2023
    Configuration menu
    Copy the full SHA
    08e5859 View commit details
    Browse the repository at this point in the history