Commit Graph

55 Commits

Author SHA1 Message Date
Sashko Stubailo
5cbe84e917 Remove error checking for <body> attrs 2015-02-24 17:14:56 -08:00
Netanel Gilad
d49af044d2 throw error instead of warning when two attributes with the same name are defined in the body. 2015-02-23 21:24:49 -08:00
Netanel Gilad
fa4e9c676e add body attributes tests 2015-02-23 21:24:49 -08:00
Netanel Gilad
48ecdf1d54 add warning when the same body attribute appears more than once. 2015-02-23 21:24:48 -08:00
Netanel Gilad
0eab851204 add body attributes to body 2015-02-23 21:24:48 -08:00
David Greenspan
0177507492 Template._body_ to Template.body 2014-08-26 17:37:52 -07:00
David Greenspan
be0e2a0139 Remove Template.__assign in favor of __checkName
It seems nice to actually write `Template[“foo”] = …` in our generated code rather than obscuring it behind __assign.
2014-08-17 12:04:25 -07:00
David Greenspan
22d4c48188 Rename Template.__create__, __define__, and others
* `Template.__create__` is now `new Template`
* `Template = Blaze.Template`
* `Template` is a constructor function
* `Template.foo instanceof Template` (but keep `Blaze.isTemplate`)
* No more `Blaze.runTemplate` (use `template.constructView`)
* `constructView` instead of `__makeView`
* template objects have `__kind` and `__render`
* No `__viewName`, `__templateName`
* `Template.__body__` is now `Template._body_` (and renamed methods)
* No `Template.__lookup__`, instead `(name in Template) && (Template[name] instance of Template)`
* `Template.__define__` replaced by `Template.__assign(name, template)`
2014-08-06 16:05:27 -07:00
David Greenspan
63a99da4d2 Tweaks to view kinds 2014-06-26 19:55:29 -07:00
David Greenspan
2bef2924a4 Make Blaze.View not require new 2014-06-26 09:51:13 -07:00
David Greenspan
7eecf9a9ff Make templates use Blaze.Views (break the world)
The path forward is to start with an empty app and get basic template tags working again, then finish rewriting the builtins (with/if/unless/each).
2014-06-25 18:08:41 -07:00
David Greenspan
a72c497276 UI.body2 -> UI.body 2014-06-21 18:19:09 -07:00
David Greenspan
bc4339c1dc Replace old codegen with codegen2 2014-05-06 14:30:48 -07:00
David Greenspan
1b6a06615e Make a simple {{test}} tag work
You put it in the body of your app and put a helper on UI.body2.  Bam.

For now, the modifications to CodeGen will go in CodeGen2.  Otherwise, the server-side "webapp" template would barf.

Gotta make more template tags work now.
2014-05-05 15:52:58 -07:00
David Greenspan
b8f7f1d093 Try out using Blaze in UI (break the world)
Basically all that works is an app with a static body :)
2014-05-01 00:13:07 -07:00
David Greenspan
fc64081c52 Move Spacebars compiler to SpacebarsCompiler
The pattern of one package defining Spacebars and another augmenting it with methods like Spacebars.parse is too confusing.

The symbols `parse`, `compile`, `TemplateTag` are now on `SpacebarsCompiler`.  You can now access `SpacebarsCompiler.optimize`, and we can start exposing more symbols.
2014-04-24 13:23:01 -07:00
Avital Oliver
d46a5e11b1 Correctly check for reserved template names 2014-01-26 11:52:27 -08:00
Avital Oliver
23405cd5d4 Don't allow templates named 'content'
Trying to include them later with {{> content}}
fails. We could disallow the other built-ins,
eg 'if' and 'elseContent' but sounds less likely
that users will try to define templates with
those names, and this simple change lets us
not duplicate code.
2014-01-22 19:35:44 -08:00
David Greenspan
cd6387cc02 Clean up DomRange, phase 1
- Get rid of DomRange "host objects" (too confusing)
- start to use `r instanceof DomRange` instead of `'dom' in r`

Ported domrange tests; all tests pass
2014-01-09 20:23:35 -08:00
David Greenspan
7e7f29c550 Perform template optimization in <body> too 2014-01-08 13:09:57 -08:00
David Greenspan
df0e414193 Route Spacebars errors properly
Now Spacebars syntax errors (as well as html_scanner errors) go through proper error reporting channels rather than throwing exceptions.  For simple cases, we are back to showing nice errors like Handlebars did on devel, with context.

Next:  Comb the spacebars compiler for errors that are thrown or lack good line numbers.  Go through our own list of bad error messages.
2014-01-06 13:48:31 -08:00
David Greenspan
7fadc29828 Start to make markdown work; avoid double UI.body 2013-12-11 22:32:48 -08:00
David Greenspan
cb2d331dbf seems to work (not fully tested) 2013-12-09 22:52:20 -08:00
David Greenspan
1952a61c53 De-2 {render,parse,compile,mustache}2 2013-12-06 01:27:07 -08:00
David Greenspan
0c087cc84a html2_scanner -> html_scanner 2013-12-06 01:22:02 -08:00
David Greenspan
2e4199e9ee get rid of 2s in file names 2013-12-06 01:19:22 -08:00
David Greenspan
7dc913723d Destroy tons of dead code 2013-12-06 01:12:25 -08:00
David Greenspan
d1e6bd1a4f spacebars: prettier code gen pretty-printing 2013-10-08 19:02:42 -07:00
David Greenspan
b88e40b0b7 hack for lexical scope of {{> content}} 2013-10-07 15:37:56 -07:00
David Greenspan
7a112872fd fix {{> content}} in {{#if} with messy hack 2013-10-07 14:27:20 -07:00
David Greenspan
6e5d73d181 fix html_scanner tests a little bit 2013-10-03 16:22:37 -07:00
Avital Oliver
4f564062a0 let packages define templates 2013-10-02 14:00:36 -07:00
David Greenspan
4add01f934 events seem to work 2013-09-17 14:25:01 -07:00
David Greenspan
2ff37d14f3 shark example seems to work (with many XXX) 2013-08-26 13:59:00 -07:00
David Glasser
75a4cf3199 Merge branch 'devel' into shark
Conflicts:
	packages/templating/deftemplate.js
	packages/templating/package.js
	packages/templating/plugin/html_scanner.js
	packages/test-in-browser/driver.js
	tools/packages.js
2013-08-01 17:17:18 -07:00
David Glasser
af06112044 templating implies spark and meteor: generated code needs them.
also finish getting rid of deprecated startup package, and some other minor
packaging cleanups to templating.
2013-07-26 19:34:45 -07:00
Geoff Schmidt
3d1c09794f Comprehensive namespace cleanup. 2013-07-25 18:54:40 -07:00
David Greenspan
95c4a2124c fix misc stuff 2013-07-25 05:22:03 -07:00
David Greenspan
c91307e32e try to get apps working (crashes Chrome) 2013-07-25 04:07:55 -07:00
David Greenspan
df3939bf2d mv ui2 ui; port spacebars (untested) 2013-07-25 01:32:18 -07:00
David Greenspan
23fa59bd77 bodies inherit from UI.Body 2013-07-16 19:45:56 -07:00
David Greenspan
3a5b5e28c8 support multiple <body> tags 2013-07-16 19:35:16 -07:00
David Greenspan
759ae2c1d7 Merge branch 'devel' into shark
Conflicts:
	packages/templating/plugin/html_scanner.js
2013-07-16 17:38:50 -07:00
David Greenspan
14f6574135 spacebars almost runnable 2013-07-16 17:31:09 -07:00
Geoff Schmidt
eb1e15e457 Improve error reporting when parsing Handlebars templates 2013-07-15 22:21:57 -07:00
David Greenspan
21ed1bdbe0 Merge branch 'linker' into shark 2013-07-01 18:54:51 -07:00
David Greenspan
8aed126bad {{@ annotations}}, better error messages 2013-06-27 10:44:55 -07:00
David Glasser
e33694874d Test slices now never contain exports.
@export is now an error in test slices.

This is preparation for ensuring that any slice with exports has at least
"Package.foo = {}"; without this commit, both the use and test slice would (with
that change) try to overwrite Package.foo.

Remove the attempt to allow @export in 'use strict' CoffeeScript files:
ECMAScript 'use strict' is fundamentally incompatible with our implementation of
exports, and it was probably a bug that this used to work at all.
2013-06-26 12:26:12 -07:00
David Greenspan
6551e3a366 search Template.foo namespace for components
fix inheritance superClass tracking
2013-06-25 05:08:14 -07:00
David Greenspan
a872fe9565 Templates in Template.foo (wip) 2013-06-20 16:25:21 -07:00