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

Make anchor & alias resolution lazier #248

Merged
merged 8 commits into from Mar 27, 2021
Merged

Make anchor & alias resolution lazier #248

merged 8 commits into from Mar 27, 2021

Commits on Mar 15, 2021

  1. Drop doc.anchors.createMergePair()

    BREAKING CHANGE: With the earlier drop of Merge as a separate class,
    createMergePair() became just a convenience wrapper with confusing
    behaviour. For the sake of simplicity, it's easier to drop it completely
    and replace calling code with:
    
    ```diff
    -doc.anchors.createMergePair(node)
    +doc.createPair('<<', doc.anchors.createAlias(node))
    ```
    eemeli committed Mar 15, 2021
    Copy the full SHA
    1399a38 View commit details
    Browse the repository at this point in the history
  2. Move createAlias() from doc.anchors to doc itself

    BREAKING CHANGE: All of the node-creating methods are now collected on
    the Document, making the API easier to use and understand.
    
    ```diff
    -doc.anchors.createAlias(node)
    +doc.createAlias(node)
    ```
    eemeli committed Mar 15, 2021
    Copy the full SHA
    0dae2dd View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2021

  1. Copy the full SHA
    3a0af0c View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2021

  1. feat!: Make anchor resolution lazy

    BREAKING CHANGE:
    - The `source` of an alias is changed from a direct reference to
      the aliased node to its `anchor` string representation instead.
    - The `anchors` member of the Document class is dropped.
    - Anchors are now stored in the `anchor` property of Scalar and
      Collection nodes.
    - Assigning the same anchor to multiple nodes will no longer
      automatically rename an earlier anchor with the same name.
    eemeli committed Mar 27, 2021
    Copy the full SHA
    f9e7625 View commit details
    Browse the repository at this point in the history
  2. feat!: Refactor & document createNode options

    BREAKING CHANGE: Previously, `replacer` was passed as an option to
    createNode(). Now it's an optional second argument, matching the API
    used by the Document constructor.
    eemeli committed Mar 27, 2021
    Copy the full SHA
    733d8d8 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    9be9080 View commit details
    Browse the repository at this point in the history
  4. feat!: Drop aliasPrefix from DocumentOptions

    BREAKING CHANGE: The behaviour of doc.createAlias() changes a bit; now
    it checks that any anchor name that it assigns to the target node is
    unique in the document.
    eemeli committed Mar 27, 2021
    Copy the full SHA
    ea7aba7 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    f12ff89 View commit details
    Browse the repository at this point in the history