Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8696547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:17:55+00:00 2026-06-13T01:17:55+00:00

Reading about the different Spark annotation types here: https://github.com/meteor/meteor/wiki/Spark I am still confused on

  • 0

Reading about the different Spark annotation types here: https://github.com/meteor/meteor/wiki/Spark

I am still confused on where Landmarks and Branch Labels need to be placed. What’s the difference between the two, and when does Handlebars call them? I am the author of the Blade templating engine, and I am trying to integrate Blade with Spark.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:17:57+00:00Added an answer on June 13, 2026 at 1:17 am

    In Handlebars, every template and every {{#constant}}…{{/constant}} region is wrapped with a landmark. When a region of the DOM is reactively updated, the old and new landmarks are matched for the purpose of DOM preservation, lifecycle callbacks (created/destroyed), and landmark-local state.

    Landmarks are identified by the “path” formed by the branch labels that contain them. (Landmarks themselves don’t contribute to the path.) It’s illegal to have two landmarks with the same path. It’s also important that you compute the HTML that will go inside the labeled region or the landmark from the body of the function argument to labelBranch or createLabel. This is because Spark is actually already matching the DOM when you call these functions so that it knows whether to call “created” (because this is a new landmark) or not (because it is a re-rendering of an old one) before running the function to calculate the HTML.

    Handlebars calls labelBranch in several places to distinguish any template (landmark) invocations that should be distinct. Basically, the labels should determine the “call stack” that led to the template invocation. Each template invocation in the template source ({{> someTemplate}}) gets a label, and loops are also instrumented, labeling each iteration of the loop based on the _id of the object in question or some other heuristics if there isn’t one. (Note that there are two code paths for loops in Meteor templating, one for observable cursors from the database and one for everything else, like normal arrays.)

    In this snippet from a template that includes the “foo” template several times, each invocation of “foo” (including each iteration of the loop) is done within a different branch label:

    {{> foo}}
    {{> foo}}
    {{#each collection}}
      {{> foo}}
    {{/each}}
    {{> foo}}
    

    What if a helper invokes template functions directly?

    var myHelper = function () {
      return Template.foo() + " " + Template.bar();
    }
    

    In this case, the day is saved because the template package also wraps each template in a label like “Template.foo” or “Template.bar” (labels are cheap). However, there will be a duplicate landmark problem if a helper calls the same template multiple times with different arguments; in this case, it is up to the helper to drop additional branch labels to disambiguate.

    The implementation of Template.foo that is generated by the templating package (in deftemplate.js) uses the following nested annotations, from outer to inner: label, data, landmark, events, isolate. This order is pretty constrained. For example, the landmark enclosing the events annotation is used to find the data. The isolate annotation is intentionally on the inside.

    The current factoring of the handlebars and templating packages may not be great for adding additional templating packages! This is a new frontier for us. We’re very interested in having more templating languages, though, and happy that you’re working on this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this article about two different types of regular expression algorithms (Perl 5.8.7
Was just reading about different algos disassemblers use to identify binary as assembly instructions.
There seem to be very different opinions about using transactions for reading from a
Reading about Django, I saw this: http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-admin - the fancy simple to use admin
Reading about Delphi's Exit statement (see here for instance), I cannot ignore that writing
I've been reading around the web about different alternatives to keeping track of users
I've been reading about CSS and I am really confused about how the inheritance
I was just reading an article about different ranking algorithms . One thing I'm
I've been reading about the different ways of programming sound into a c# XNA
Possible Duplicate: function call with different semantics I am reading about function pointers in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.