cmather / blaze-layout Goto Github PK
View Code? Open in Web Editor NEWA Meteor Blaze powered layout component for dynamic rendering.
License: Other
A Meteor Blaze powered layout component for dynamic rendering.
License: Other
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
You cannot currently use the {{#with}} block helper to set a data context for a yield region. You can only set a global data context for the layout using layout.data({}); This is obviously no bueno.
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.
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.
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.
See iron-meteor/iron-router#667
Reproduction: https://github.com:tmeasday/IR693
The issue is due to https://github.com/EventedMind/blaze-layout/blob/master/layout.js#L144
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:
titleTemplate='foo'
perhaps?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..
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.
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:
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.
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.
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
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:
meteor create repro
cd repro
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?
I'm running into an error when attempting to install blaze-layout:
Have you seen this error yet when installing blaze-layout @cmather?
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?
Considering that
contentFor
we have a wrapper around it (usually a header
, footer
or just a div
with some classes);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?
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?
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'
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"
}
}
}
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.