       templateBase = componentClassTemplate
       assert templateBase
 
+    try
+      data = Template.currentData()
+    catch error
+      # The exception can be thrown when there is no current view which happens when
+      # there is no data context yet, thus also no arguments were provided through
+      # "args" template helper, so we just continue normally.
+      data = null
+
+    if data?.constructor is argumentsConstructor
+      argumentsProvided = true
+      # Arguments were provided through "args" template helper, use them with the constructor.
+      component = new componentClass data._arguments...
+    else
+      argumentsProvided = false
+      component = new componentClass()
+
     # Create a new component template based on the Blaze template. We want our own template
     # because the same Blaze template could be reused between multiple components.
     # TODO: Should we cache these templates based on (componentName, templateBase) pair? We could use tow levels of ES6 Maps, componentName -> templateBase -> template.

      # @ is a template instance.
      @component.onDestroyed()

    template

  @template: ->
    # You have to override this method with a method which returns a template name or template itself.

for methodName, method of Blaze.TemplateInstance::
  BlazeComponent::[methodName] = (args...) ->
    @templateInstance[methodName] args...

argumentsConstructor = ->
  # This class should never really be created.
  assert false

Template.registerHelper 'args', ->
  obj = {}
  # We use custom constructor to know that it is not a real data context.
  obj.constructor = argumentsConstructor
  obj._arguments = arguments
  obj
