Coder Social home page Coder Social logo

iron-layout's People

Contributors

avital avatar brettle avatar chrisbutler avatar cmather avatar joeapearson avatar tmeasday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iron-layout's Issues

"You called beginRendering again before calling endRendering"

I see this a lot now after upgrading to devel iron-router:

Layout.prototype.beginRendering = function () {
  if (this._renderedRegions)
    throw new Error("You called beginRendering again before calling endRendering");
  this._renderedRegions = {};
};

I error there, on the error thrown.

My observations of the state of the app when this error is thrown:

  • I will hit the error, and one of the regions in the layout will be rendered, but a different one will not. For example, I'll have this layout:

    <template name="layout">
    {{> yield region='navbar'}}
    
    <div id="container-main" class="container layout-1up">
        {{> yield region='sidebar'}}
    
        <div id="inner-main">
            {{> yield}}
        </div>
    </div>
    </template>
    

    and the main yield will have rendered, the navbar will have not rendered, and I throw the error.

  • I'm in a route with a reactive action. This may be a red herring.

    ...
          action: function () {
              // Something reactive:
              if (Meteor.user()) {
                  // Dies here:
                  this.redirect('some path');
              } else {
                  this.render();
              }
          }
    ...
    });
    

Problem with tinytest

I've hit a problem when using iron:router in a package with Tinytest. The issue has already been raised (next door) iron-meteor/iron-router#1349. It can easily be replicated as follows:

$ meteor create dummy
$ cd dummy
$ meteor create --package paq

Then add iron router into the package.js file

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use('iron:router');
  api.addFiles('paq.js');
});

Running the tests gives the following in the browser console

Uncaught TypeError: Template.__create__ is not a function
Uncaught TypeError: undefined is not a function
Uncaught TypeError: Cannot read property 'RouteController' of undefined
Exception in defer callback: TypeError: Cannot read property 'insert' of undefined
at Utils.extend.autoRender (http://localhost:3000/packages/iron_router.js?21e016398976d1792ea62f1079e9141f6b298416:1627:17)
at http://localhost:3000/packages/iron_router.js?21e016398976d1792ea62f1079e9141f6b298416:1456:16
at _.extend.withValue (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:955:17)
at withoutInvocation (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:435:45)
at Object.Meteor.bindEnvironment (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:983:22)
at onGlobalMessage (http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:372:23)

I have tried mocking it with mocks.js

Template = function() { /* do nothing */ }

and package.js

Package.onTest(function(api) {
  api.use('tinytest');
  api.addFiles('mocks.js');
  api.use('paq');
  api.addFiles('paq-tests.js');
});

but I still get the error.

Is DynamicTemplate's onRender hook missing?

Inside Layout.prototype._createDynamicTemplate function (line 190-199), It sets to run hook 'onRenderRegion' ,when the dynamic template's onRender hook. onRender function is undefined.

I couldn't find the onRender function inside the dynamic_template.js from iron-dynamic-template package. I also grep meteor core packages (as of 0.8.2) with no luck.

@cmather Could you give me any pointer on where I can find onRender?

Uncaught Error: No Iron.Layout found so you can't use yield!

Hi...

I have just recently migrated my meteor project (under development) to meteor 0.9.0.1 and followed all instructions for the migration of packages. However, whenever i open a template, this error keeps popping up although I have already added the Iron-Layout package via meteor add iron:layout. I am not sure if this is an iron-layout issue or caused by other packages which are dependent on iron-layout.

The complete error are as follows:

info:  [famous-views]  Current logging default is "debug".  Change in your app with  Logger.setLevel("famous-views", "info"); console.coffee:18
warn:  [famous-views]  Creating a new main context.  If you already have your own, set FView.mainCtx = yourMainContext (or to false to get rid of this warning) console.coffee:18
debug:  [famous-views]  New SequentialLayout (#1), content from "appLayout" (parent: Template.famousInit) console.coffee:18
debug:  [famous-views]  New HeaderFooterLayout (#2), content from inline block (parent: Template.appLayout) console.coffee:18
debug:  [famous-views]  New Surface (#3), content from "yieldHeader" (parent: Famous.HeaderFooterLayout, template: Template.appLayout) console.coffee:18
Uncaught Error: No Iron.Layout found so you can't use yield! layout.js:290
debug:  [famous-views]  New HeaderFooterLayout (#4), content from inline block (parent: Template.appLayout) console.coffee:18
debug:  [famous-views]  New Surface (#5), content from "yieldHeader" (parent: Famous.HeaderFooterLayout, template: Template.appLayout) console.coffee:18
debug:  [famous-views]  New View (#6), content from "yieldMain" (parent: Famous.HeaderFooterLayout, template: Template.appLayout) console.coffee:18
debug:  [famous-views]  New RenderController (#7), content from inline block (parent: Template.mainPanel) console.coffee:18
debug:  [famous-views]  New Surface (#8), content from inline block (parent: if, template: Template.home) console.coffee:18
debug:  [famous-views]  New Surface (#9), content from "yieldFooter" (parent: Famous.HeaderFooterLayout, template: Template.appLayout) console.coffee:18

where the Uncaught Error are as follows:

Uncaught Error: No Iron.Layout found so you can't use yield!        layout.js:290
   (anonymous function)                                             layout.js:290
   doRender                                                         view.js:194
   (anonymous function)                                             view.js:142
   Blaze.withCurrentView                                            view.js:375
   viewAutorun                                                      view.js:141
   Deps.Computation._compute                                        deps.js:196
   Deps.Computation                                                 deps.js:130
   Deps.autorun                                                     deps.js:344
   Blaze.View.autorun                                               view.js:140
  (anonymous function)                                              view.js:188
   Deps.nonreactive                                                 deps.js:364
   Blaze.materializeView                                            view.js:187
   Blaze.DOMMaterializer.def.visitObject                            materializer.js:116
   HTML.Visitor.def.visit                                           visitors.js:61
   doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61Blaze.DOMMaterializer.def.visitArray materializer.js:21HTML.Visitor.def.visit visitors.js:59Blaze.DOMMaterializer.def.visitTag materializer.js:99HTML.Visitor.def.visit visitors.js:46doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187famousCreated famous.js:254(anonymous function) templating.js:127fireCallbacks view.js:155Deps.nonreactive deps.js:364(anonymous function) view.js:152Blaze.withCurrentView view.js:375Blaze._fireCallbacks view.js:151Blaze.materializeView view.js:167Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61Blaze.DOMMaterializer.def.visitArray materializer.js:21HTML.Visitor.def.visit visitors.js:59doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187famousCreated famous.js:254(anonymous function) templating.js:127fireCallbacks view.js:155Deps.nonreactive deps.js:364(anonymous function) view.js:152Blaze.withCurrentView view.js:375Blaze._fireCallbacks view.js:151Blaze.materializeView view.js:167Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61Blaze.DOMMaterializer.def.visitArray materializer.js:21HTML.Visitor.def.visit visitors.js:59doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187famousCreated famous.js:254(anonymous function) templating.js:127fireCallbacks view.js:155Deps.nonreactive deps.js:364(anonymous function) view.js:152Blaze.withCurrentView view.js:375Blaze._fireCallbacks view.js:151Blaze.materializeView view.js:167Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61doMaterialize view.js:199Deps.nonreactive deps.js:364doRender view.js:197(anonymous function) view.js:142Blaze.withCurrentView view.js:375viewAutorun view.js:141Deps.Computation._compute deps.js:196Deps.Computation deps.js:130Deps.autorun deps.js:344Blaze.View.autorun view.js:140(anonymous function) view.js:188Deps.nonreactive deps.js:364Blaze.materializeView view.js:187Blaze.DOMMaterializer.def.visitObject materializer.js:116HTML.Visitor.def.visit visitors.js:61Blaze.DOMMaterializer.def.visitArray materializer.js:21HTML.Visitor.def.visit visitors.js:59doMaterialize view.js:199Deps.nonreactive deps.js:364

Here are my packages:

standard-app-packages           1.0.0  Include a standard set of Meteor packa...
less                            1.0.6  The dynamic stylesheet language
natestrauser:connection-banner  0.4.3  A banner that displays when meteor ser...
mystor:device-detection         0.2.0  Client-Side Device Type Detection & Te...
raix:famono                     0.7.4* Library bundler supports use of librar...
iron:router                     0.9.1  Routing specifically designed for Meteor
iron:layout                     0.3.0  Dynamic layouts which enable rendering...
mizzao:bootstrap-3              3.2.0  HTML, CSS, and JS framework for develo...
accounts-base                   1.0.0  A user account system
accounts-password               1.0.0  Password support for accounts
mrt:accounts-ui-bs3-and-blaze   0.4.2  Bootstrap styled version of login widgets
famous-components               0.0.23  Blaze Views for Famous; doing Famous ...

I'm on Ubuntu 14.04 64-bit.

What seems to be the error behind this? Any help would be very much appreciated.

Thanks in advance.

Update Package to newest

Behind a corporate proxy so can't use meteor add directly, this repo is behind?

Get following error when installed manually with all of the iron-router packages.

TypeError: Object [object Object] has no method '_setLookupHost'
    at [object Object].Controller (packages/iron:controller/lib/controller.js:25:1)
    at new Controller.extend.constructor (packages/iron:router/lib/route_controller.js:14:1)
    at [object Object].ctor (packages/iron:core/lib/iron_core.js:88:1)
    at Function.Router.createController (packages/iron:router/lib/router.js:201:1)
    at Function.Router.dispatch (packages/iron:router/lib/router_server.js:39:1)
    at Object.router (packages/iron:router/lib/router.js:15:1)

FYI changed code in package.js to

Package.describe({
  summary: 'Dynamic layouts which enable rendering dynamic templates into regions on a page.',
  version: '1.0.8', //1.0.0-pre3
  git: 'https://github.com/eventedmind/iron-layout',
  name: 'iron:layout'
});

yield regions do not work if no main region is yielded

I woked out this simple case for showcasing the problem

template(name='dynamic_template')
    h4 region1
    +yield 'region1'
    h4 main
    // without the main yield  no region is rendered at all
    +yield

    h4 region2
    +yield 'region2'
template(name='dynamic_template_caller')
    +Layout template='dynamic_template' data=something
        |main
        +contentFor 'region1'
            |content of region 1
        +contentFor 'region2'}}
            |content of region 2
  • without the main yield (+yield) neither +yield 'region1' nor +yield 'region1' are rendered
    • Any call to hasRegion 'region1' helper returns false in this case.
  • putting +yield back in renders all three correctly.

Should dynamic templates with only named regions (=without a main region) be supported ?

EDIT : rephrasing made clear in which case hasregion is not supported

`Deps is not defined` in Meteor 1.2

After upgrading to Meteor 1.2, the following error shows:

Exception in callback of async function: ReferenceError: Deps is not defined
    at Layout.beginRendering (http://192.168.56.101:4500/packages/iron_layout.js?e780915e25c3eabb4e4cf232e4a5135d85f05020:290:3)
    at Controller.beginRendering (http://192.168.56.101:4500/packages/iron_controller.js?9d2e717544918c706f196546cf95012eaae0fb76:292:23)
    at RouteController._runRoute (http://192.168.56.101:4500/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:472:8)
    at Function.Route.dispatch (http://192.168.56.101:4500/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:856:18)
    at route (http://192.168.56.101:4500/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:713:11)
    at boundNext (http://192.168.56.101:4500/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:425:31)
    at Meteor.bindEnvironment (http://192.168.56.101:4500/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:22)
    at boundNext (http://192.168.56.101:4500/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:372:14)
    at Meteor.bindEnvironment (http://192.168.56.101:4500/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:22)
    at boundNext (http://192.168.56.101:4500/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:372:14)

at this line:

Deps.afterFlush(this._finishRenderingTransaction);         

It doesn't appear that reverse compatibility should have been broken in Meteor 1.2, so I'm not sure what is causing this.

"You called beginRendering again before calling endRendering", different cause

I'll build the repro later today, but here's the bug:

Throws "You called beginRendering again before calling endRendering" error:

Router.map(function () {
    this.route('landingPage', {
        path: '/',
        action: function () {
            if (Meteor.user()) {
                this.redirect(nonreactiveFunctionThatGivesMeAPath());
            } else {
                this.render();
            }
        }
    });
});

Does not throw error, does the same thing:

Router.map(function () {
    this.route('landingPage', {
        path: '/',
        waitOn: function() {
            // Gets the user data
            return Meteor.subscribe('me');
        },
        action: function () {
            // Wait until I actually have data
            if (this.ready()) {
                // Now check if I'm logged in, non-reactively
                var user;
                Deps.nonreactive(function() {
                    user = Meteor.user();
                });
                if (user) {
                    this.redirect(nonreactiveFunctionThatGivesMeAPath());
                } else {
                    this.render();
                }
            } else {
                this.render();
            }
        }
    });
});

On meteor devel, error: no such package: 'blaze-layout'

I'm inching towards it...

While building package `iron-layout`:
error: no such package: 'blaze-layout'

My smart.json:

{
 ...
    "iron-router": {
      "git": "https://github.com/EventedMind/iron-router.git",
      "branch": "feature/iron-layout"
    }
 ...
}

Templates are broken empty <body> in client HTML

I have had this problem since updating a day ago. No templates work I have tried my code and the microscope git code only the head has anything in it the body is empty on client. I would go back to a older version but I was dumb and tried deleting and reinstalling meteor so I can't please fix this Thanks
I just closed it because it randomly stopped but it randomly just started aging.

Add test cases for various types of data inheritance

Off the top of my head:

  1. When there's a {{#with}} around a {{> yield}}
  2. When there's a {{#with}} around a {{> yield}}, and the data is set via {{#contentFor data=X}}
  3. When there's no {{#with}}, and no data is set.

Circular dependency with Meteor 0.8.2 / 0.8.3

iron-layout depends on blaze-layout, so both of them must be installed, however:
=> Errors prevented startup:
While building the application:
error: circular dependency between packages blaze-layout and iron-router
error: circular dependency between packages blaze-layout and iron-layout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.