Commit Graph

47 Commits

Author SHA1 Message Date
David Glasser
f36abc946e Generalize "load *.html files first" hack
Now any plugin can request that its files be treated as "templates" by
setting an isTemplate flag.

(This API is just as supported as you'd expect based on the fact that
you still can't access it without calling a function which starts with
"_transitional_".)

Tested by renaming leaderboard.js to a.js and confirming that it still
works (and that it *doesn't* if templating does not set isTemplate).
2014-04-01 17:21:24 -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
47953854bb Render test results using html2! break embox...
This commit does the minimum to switch to the new renderer,
by mapping .html to html2_scanner.  Now we have to remove
all the references to "2" and all the old dead code, of course.

Our use of emboxValue breaks test-in-browser pretty severely
by assuming that in `{{#each results}}`, if `results` is `===`
to what it was last time, then there is no change.  In fact,
test-in-browser mutates arrays and expects invalidating the
result to cause a re-render.
2013-12-06 00:32:12 -08:00
David Greenspan
6397fec3dc Port html_scanner tests; detect duplicate templates
Reintroduce a Template.__define__ (like on devel)

Remove old compiler tests
2013-12-05 16:31:59 -08:00
David Greenspan
ccd3e185fc making block helpers work 2013-12-03 14:23:18 -08:00
David Greenspan
ae7ac181fc pass .html2 files to the new rendering system
this is a temporary state of affairs for testing the branch
2013-11-22 15:03:11 -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
a342232868 Merge branch 'devel' into shark 2013-07-12 20:27:43 -07:00
David Glasser
faf49921be replace barely-used lineForLine/includePositionInErrors with use of source maps.
Note that this is only triggered when coffeescript manages to output invalid JS,
which should be unlikely.

This does remove the feature where lines and columns were suppressed for parse
errors in the output of template compilation. but (a) that shouldn't happen,
and (b) we'll fix this by implementing source maps for spacebars.
2013-07-12 10:11:31 -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
David Greenspan
6c118d97f0 warn when Body not a RootComponent 2013-06-17 17:18:38 -07:00
David Greenspan
dc75e8877b use spacebars for templating in build 2013-06-17 17:18:38 -07:00
Geoff Schmidt
0b2d536e38 Clean up error reporting in HTML template scanner 2013-05-13 11:56:51 -07:00
Geoff Schmidt
ed18c6ffb5 Comprehensive build-time error reporting system. In particular: if an error occurs, the build will try to continue to identify any other potential problems so that they can be flagged too. Syntax errors are captured and dealt with programmatically, rather than just being echoed to stderr by node. Stack traces are parsed to pull out file and line information, and a distinction is made between the 'user' and 'internal' portions of the stack. All of this is at build time only -- it has not been extended to (run-time) server or browser yet. Also, no source maps yet, though line numbers are computed correctly for units within the linker. 2013-05-13 11:52:43 -07:00
Geoff Schmidt
8c72a28e35 Port coffeescript package to new plugin API 2013-05-13 11:52:43 -07:00
Geoff Schmidt
d5660c3938 Make 'templating' use the new plugin API. Now handlebars can be a separate package again. 2013-05-13 11:52:43 -07:00