Coder Social home page Coder Social logo

blaze-layout's People

Contributors

avital avatar cmather 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blaze-layout's Issues

ReferenceError: Tinytest is not defined

I've uninstalled and reinstalled iron-router and blaze-layout several times, and this ReferenceError is what comes up every time I attempt to run. Do you possibly know a solution? I've searched everywhere, and have seen similar but not exact reproduction and so the remedies unfortunately have not been fruitful.

Meteor/microscope/.meteor/local/build/programs/server/boot.js:186}).run();
^
ReferenceError: Tinytest is not defined
at app/server/packages/blaze-layout/layout-test.js:49:1
at app/server/packages/blaze-layout/layout-test.js:217:3
at microscope/.meteor/local/build/programs/server/boot.js:
at Array.forEach (native)
at Function..each..forEach (/.meteor/tools/c2a0453c51/lib/node_modules/underscore/underscore.js:79:11)
at /microscope/.meteor/local/build/programs/server/boot.js:82:5

Couldn't find a Layout component

I've converted old working app from 0.7.x to 0.8.0, now I'm getting this error all the time:

Error: Couldn't find a Layout component in the rendered component tree

There doesn't seem to be anything in the doc regarding how the layouts should now be done.

#each iterator

Is there still a solution for a working iterator for the #each operation in my template ?

The last solutions are not working anymore in the newest meteor version.

template was not found when its in dir "tests"

Hey!

I had problems because blazeLayout did not found my template which was defined. After a few minutes i moved the file into another dir and than it works.

/client/views/business/template.html works fine.
/client/views/business/a/template.html works fine.
/client/views/business/a/b/template.html works fine.
/client/views/business/tests/template.html do not work!

Dont know if this is wanted or if this is an error.

Making regions more usable.

Howdy @cmather

So I'm working on converting Verso over to BL and it makes heavy use of layouts. One thing that we used to do with our old janky layouts system was bind helpers to regions. So something like

<template name="somePage">
  {{#Layout template='pageLayout' title=title}}
    ...
  {{/Layout}}
</template>

<template name="pageLayout">
  <h1>{{> yield region='title'}}</h1>
 {{> yield}}
</template>
Template.somePage.title = function() { return 'Dashboard'; }

So essentially we are passing the content for a region in via the arguments to {{#Layout.

What do you think?

Related ideas:

  • set a region content to a template in a similar way? titleTemplate='foo' perhaps?
  • remove the need for the redundant feeling title=title and just automatically search for a helper named title when trying to {{> yield region='title'}} if no content is set for that region.

Happy to implement whatever (actually I'll probably implement the first thing right now in a branch) if you agree on the API..

iron-router dependencies

Error happened while buidling package:

iron-router: updating npm dependencies -- connect...
=> Errors prevented startup:
While building package iron-router:
error: no such package: '[email protected]'
error: no such package: '[email protected]'
error: no such package: '[email protected]'
error: no such package: '[email protected]'
error: no such package: '[email protected]'
error: no such package: '[email protected]'
error: no such package: 'iron'
error: no such package: 'cmather'
error: no such package: '[email protected]'

=> Your application has errors. Waiting for file change.

Remove Component.lookup and Component.lookupTemplate overrides

cc @avital, @estark37, @tmeasday

In order to make "yield" and "contentFor" work with blaze in the last release of blaze-layout/iron-router, we overrode Component.lookup and Component.lookupTemplate. This is now breaking with additions that have been made to these functions in Core (related to UI._templateInstance()) in release/0.8.1-rc2. See:
iron-meteor/iron-router#691 (comment).

We should remove these overrides provided we can meet or change our original use cases. Those use cases are:

  1. When {{> yield}} is called, find the parent Layout component and call the yield method defined on that component.
  2. When {{> contentFor}} is called, find the parent Layout component and call the contentFor method defined on that component.
  3. When {{yield}} is called provide a helpful error message like: "Sorry, would you mind using {{> yield}} instead of {{yield}}?"

It's not immediately clear how we can tell Spacebars to lookup a rendered hierarchy of components for a method defined further up in the chain. But I recall some designs for this in Meteor's Blaze v2 hackpad. I need to verify that something exists. Alternatively, we can add the UI._templateInstance implementation logic to our override. But I'm hoping we can remove this hack.

Problem installing Blaze Layout

Never seen this error before from Meteorite, but I went to update an old app that's been untouched for the last 2 or 3 months(shortly after 0.8.0 release) and received the following error:

Problem installing blaze-layout
✘ [branch: https://github.com/EventedMind/blaze-layout.git#master] conflicts with [latest]
Can't resolve dependencies! Use --force if you don't mind mrt taking a wild guess and running your app anyway.

Error with meteor bundle

When I try to 'meteor bundle app.tgz' an error occur:

Errors prevented bundling:
While building package `blaze-layout`:
error: no such package: 'ui'
layout-test.html:16: Parse error:
...}  {{> yield region="footer"}}
----------------------^
Expecting 'CLOSE', 'DATA', 'STRING', 'INTEGER', 'BOOLEAN', 'ID', 'SEP', got 'EQUALS'

I'm using last 'shark' branch of meteor and last IR 'blaze-integration'.

Thanks

Breaks `meteor add` for 0.7.1.2 if installed locally

This could be a Meteor issue, but starting here.

meteor add breaks if you have blaze-layout installed using the local repository method for installing it as described in the Iron Router readme.

To reproduce, clone blaze-layout to your PACKAGE_DIRS directory. Then:

  1. meteor create repro
  2. cd repro
  3. meteor add bootstrap (or add any unrelated Meteor package)

Error excerpt: "While building package blaze-layout: error: no such package: 'ui'". I could get it to work by temporarily renaming blaze-layout's package.js file.

It seems clear that Meteor is scanning all the local packages, even ones you haven't installed on the current project, and it is finding the dependency on the ui package, which doesn't exist in the non-blaze main release of Meteor. Is there a problem with blaze-layout? Should I report this on meteor itself? Or perhaps I just did something wrong?

BlazeUIManager doesn't render with a parent context (`UI.Body` doesn't work).

See repro here: https://github.com/dburles/ir-ui-body

UI.Body.helpers and UI.Body.events are going to become more of a standard for global Meteor stuff no doubt (perhaps even replace Handlebars.registerHelpers?)

Anyway, my diagnosis is the problem is you call UI.render(Layout) without passing in the parent component (which should be UI.Body I guess?). Do we need to fetch it from document.body when .insert() is called? In which case should render() and insert() really be separated?

[Request] Ability to check if a given 'contentFor' has been set

Considering that

  • almost every time we use a contentFor we have a wrapper around it (usually a header, footer or just a div with some classes);
  • when there is no content for a given region, usually there is no reason to keep the empty wrapper there.
  • a wrapper with no content is obviously harder to hide than a wrapper that just does not exist.
    • Sometimes it can be considerable hard to hide the empty wrapper without screwing the rest of your css.

Than I infer that we should have a way to use some kind of if statement to check if we should add a region code with its wrapper inside our html.

That's an example to express my idea:

<template name="MyLayout">
  <h1>My Layout</h1>

  <div>
    {{> yield}}
  </div>

{{#if [THE FOOTER CONTENT HAS BEEN DEFINED]}}
  <footer>
    {{> yield region="footer"}}
  </footer>
{{/if}}
</template>

Is there a way to do it now? If not, is it possible for us to implement it, and what would be a good "syntax" for that?

Installation Error

I'm having problems installing blaze-layout:

Problem installing blaze-layout
  ✘ [branch: https://github.com/EventedMind/blaze-layout.git#master] conflicts with [branch: https://github.com/EventedMind/blaze-layout.git#devel]
Can't resolve dependencies! Use --force if you don't mrt taking a wild guess and running your app anway.

Here is my smart.json file:

{
  "packages": 
  {
    "accounts-ui-bootstrap-dropdown": {},
    "font-awesome": {},
    "accounts-ui-bootstrap-3": 
    {
        "git": "https://github.com/mangasocial/meteor-accounts-ui-bootstrap-3.git",
        "branch": "blaze"
    },
    "bootstrap3-less": {},
    "moment": {},
    "bootstrap3-datetimepicker": {},
    "iron-router": 
    {
        "git": "https://github.com/EventedMind/iron-router.git",
        "branch": "blaze-integration"
    },
    "inspector": {},
    "blaze-layout": 
    {
        "git": "https://github.com/EventedMind/blaze-layout.git",
        "branch": "devel"
    }
  }
}

I've tried to use the --force and the error goes away. However, when I try to use the blaze-layout features it doesn't work as expected. How can fix this?

Should iron-router be a dependency?

I understand that iron-router uses blaze-layout as dependency, but why the other way around? Isn't this a mistake?

$ mrt create myProject
myProject: created.

To run your new app:
   cd myProject
   meteor

$ cd myProject/
$ mrt add blaze-layout
✓ blaze-layout
    tag: https://github.com/EventedMind/blaze-layout.git#v0.2.5

Done installing smart packages

Stand back while Meteorite does its thing

Done installing smart packages

Ok, everything's ready. Here comes Meteor!

=> Errors while scanning packages:

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

[Blaze-rc1]: Uncaught ReferenceError: Spark is not defined

I encountered this issue after uploading to blaze-rc1

My smart.json:

{
"meteor": {
"git": "https://github.com/meteor/meteor.git",
"branch": "shark"
},
"packages": {
"iron-router": {
"git": "https://github.com/EventedMind/iron-router.git",
"branch": "blaze-integration"
},
"scss": {},
"spin": {},
"accounts-ui-bootstrap-3": {},
"collection2": {},
"autocompletion": {},
"bootstrap-3": {},
"fast-render": {},
"moment": {},
"blaze-layout": {
"git": "https://github.com/EventedMind/blaze-layout.git",
"branch": "devel"
}
}
}

Nested Layouts

This may already be possible. However it would be nice to be able to embed layouts within one another.

For Example: (currently throws max call stack size exceeded)

<!-- app layout -->
<template name="app">
  <div class="app">
    <header class="app__header">{{> header}}</header>
    <aside class="app__sidebar">{{> yield region="sidebar"}}</aside>
    <main class="app__content">{{> yield}}</main>
  </div>
</template>

<!-- foo layout -->
<template name="foo">
  {{#Layout template="app"}}
    {{#contentFor region="sidebar"}}
      Foo Sidebar
    {{/contentFor}}
    <div class="foo">
      <div class="foo__header">Foo</div>
      <div class="foo__content">{{yield}}</div>
    </div>
  {{/Layout}}
</template>

<!-- foo index page -->
<template name="fooIndex">
  {{#Layout template="foo"}}
    Welcome to foo index!
  {{/Layout}}
</template>
<div class="app">
  <header class="app__header"><!-- ... --></header>
  <aside class="app__sidebar">Foo Sidebar</aside>
  <main class="app__content">
    <div class="foo">
      <div class="foo__header">Foo</div>
      <div class="foo__content">Welcome to foo index!</div>
    </div>
  </main>
</div>

You can also clone this repository to see the current behavior (throws an error): https://github.com/thejameskyle/meteor-nested-blaze-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.