Commit Graph

43 Commits

Author SHA1 Message Date
ekatek
fb709c9563 remove versions files from core packages 2014-06-16 22:11:31 -07:00
David Glasser
c5e5305a3b Merge branch 'devel' into packaging
Conflicts:
	tools/bundler.js
	tools/packages.js
2014-06-11 12:02:57 -07:00
Emily Stark
4b6d3b2681 Reshuffle packages to allow ui to depend on ui-dynamic-template.
Remove the spacebars-compiler -> spacebars and spacebars-compiler -> ui
dependencies. With those dependencies, ui cannot depend on
ui-dynamic-template, because ui-dynamic-template depends on templating,
whose build plugin depends on spacebars-compiler, who depends on
spacebars who depends on ui.

spacebars-compiler doesn't actually need to depend on ui or spacebars;
it only needs to depend on spacebars to add things to the `Spacebars`
namespace, which this commit does by factoring out the Spacebars export
into a separate `spacebars-common` package.
2014-05-28 14:37:12 -07:00
Matthew Arbesfeld
f90e09fbe5 Fix for #2175 - Spacebars block comment cause unexpected errors
This fixes an edge case where a comment is followed immediately
by an {{else}} token.
2014-05-27 03:36:50 -04:00
ekatek
beb0e59b9d new version files from teh new solver? Also, package.js correct with tests 2014-05-09 17:36:25 -07:00
ekatek
031890d2c5 don't store buildtime deps in the catalog 2014-05-04 16:56:58 -07:00
ekatek
23ad149a78 better versions files 2014-04-25 15:06:45 -07:00
ekatek
10d2047d12 clean up 2014-04-25 15:01:20 -07:00
ekatek
c84c8d6097 alphabetize package version lock files 2014-04-24 18:18:21 -07:00
David Glasser
3d3bdd4f50 versions.json update (these should be sorted!) 2014-04-24 17:02:46 -07:00
David Glasser
fbde0a00a7 Merge branch 'publish-packages' into library-refactor
Conflicts:
	packages/domutils/package.js
	packages/handlebars/package.js
	packages/htmljs/package.js
	packages/liverange/package.js
	packages/spark/package.js
	packages/universal-events/package.js
	tools/bundler.js
	tools/help.txt
	tools/packages.js
	tools/run-app.js
	tools/run-mongo.js
	tools/skel/.meteor/packages
2014-04-24 17:01:36 -07:00
David Greenspan
6454067e66 Make Blaze packages internal 2014-04-02 09:56:33 -07:00
David Greenspan
1fcb33e61b parse.js: Add more comments 2014-03-22 09:57:46 -07:00
Avital Oliver
9ef97fc297 Better parsing for {{! }} comments
We now no longer check whether we're at a closing
HTML tag by peeking for "</" since that would fail
if there were a {{! }} comment directly before it.

Instead, we tokenize and then rewind. Presumably
this does have an effect on compilation time but it's
probably fine. An alternative would have been to
explicitly parse {{! }} comments rather than implicitly
skipping them before generally parsing tokens.
2014-03-21 22:08:02 -07:00
David Greenspan
cf4d9ad175 Let tags containing ':' self-close
They won't be rendered to HTML as self-closing, but that should be ok.

This is so that weird XML tags in SVG can be parsed.
2014-03-06 16:51:26 -08:00
David Greenspan
57f11cb961 Use HTMLTools namespace for all of html-tools 2014-03-03 15:51:35 -08:00
David Greenspan
5e85c32ea6 Move asciiLowerCase to html-tools 2014-03-03 15:51:35 -08:00
David Greenspan
f6c766ae06 Start html.js refactor; case-fold at compile time
- Start shrinking html.js down to the 150-line file it can be
- Move "proper case" logic to the template compiler; the tagName of an HTMLjs tag is now in proper case.  This is both for better performance and reduced size and complexity of runtime code (i.e. blaze.js).
- Start moving html-tools to the HTMLTools namespace
2014-03-03 15:51:35 -08:00
David Greenspan
5038c63d08 Merge shark, including shark-isolate-helpers work 2014-01-27 15:21:23 -08:00
David Greenspan
599ac16632 Treat null/undefined/false attributes as absent
So, in HTML, the following are equivalent, and both mean that a checkbox is checked, because the `checked` attribute is present:

- `<input type="checkbox" checked>`
- `<input type="checkbox" checked="">`

We can't mess with that.  On the other hand, in Spacebars before this commit, the following would *also* result in the checkbox being checked, regardless of whether `foo` evaluates to null, undefined, false, or the empty string:

- `<input type="checkbox" checked={{foo}}>`
- `<input type="checkbox" checked="{{foo}}">`

With this commit, the checkbox will NOT be checked if `foo` evaluates to null, undefined, or false.

To achieve this:

- In HTMLjs, an attribute is considered absent if its value is "nully" after being fully evaluated (i.e. after expanding functions and components via HTML.evaluateDynamicAttributes / HTML.evaluate).  A nully value is one consisting of null, undefined, an empty array, or an array of those things.  `false` is not nully and renders as "false".  An empty string is not nully, and will "prop open" an attribute that would otherwise collapse into absence.

- Spacebars.mustache converts null, undefined, and false to null.  So if you use {{foo}} anywhere in a template and foo evaluates to "false", that gets to converted to a null in HTMLjs (which is ignored).  (true is rendered as "true".)

- When parsing HTML, an attribute that consists of *no tokens* becomes an empty string in the HTMLjs, which props open the attribute (unlike null or an empty array).  (Since comment tokens are stripped during tokenization, if there are only comments in an attribute value that counts as no tokens.)
2014-01-27 14:44:19 -08:00
David Greenspan
43cb4f8cc8 Rename tests in html-tools package to html-tools 2014-01-27 14:44:19 -08:00
David Greenspan
635b2c3910 Merge branch 'shark' into shark-newargs 2014-01-25 19:43:28 -08:00
David Greenspan
0e0d8f218c Better error message for <circle r={{r}}/>
Now we tell you to put a space before the slash.  HTML allows slash as part of a bare attribute value.
2014-01-25 19:41:21 -08:00
David Greenspan
b9378d02b7 remove duplicate test 2014-01-25 17:52:37 -08:00
David Greenspan
7be0250867 Fix CRLF handling in HTML tokenizer
We would choke on CR line endings, because we didn't implement the preprocessing step of converting CR(LF)? to LF.  Now we correctly convert (or ignore) CR inside tags, in text nodes, in attributes, and in comments.
2014-01-20 19:19:07 -08:00
David Greenspan
56e94821e3 Spacebars: better errors, comment handling
Give better errors (and in some cases, errors at all) for cases like:
- `<a {{{x}}}>`
- `<a {{#if x}}foo{{/if}}>`
- `<a {{k}}={{v}}>`
- `<a x{{y}}=z>`

Also, allow comments (`{{! x}}`) anywhere a non-comment tag is allowed
2014-01-13 13:04:27 -08:00
David Greenspan
b9455835c3 add example to html-tools README 2014-01-08 11:24:11 -08:00
David Greenspan
5ed450921d More wordsmithing 2014-01-06 21:38:39 -08:00
David Greenspan
f50e0a4973 prose edits 2014-01-06 21:29:10 -08:00
David Greenspan
40d4d9cd84 document html-tools 2014-01-06 21:25:40 -08:00
David Greenspan
fe08fa7471 Fix ellipsis in error display; test errors 2014-01-06 15:54:23 -08:00
David Greenspan
27118d4b5a Improve error message for <input></input>
...and other cases where we see an unexpected HTML end tag.  We'd previously say "Expected EOF", among other things.
2014-01-06 15:41:51 -08:00
David Greenspan
1f25f2a824 fix more Spacebars errors 2014-01-06 15:01:15 -08:00
David Greenspan
b42112e3e6 tweaks 2014-01-06 14:37:13 -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
30a4b2b7d4 Fix bug in parsing of HTML attributes
e.g. <foo bar baz>.  (D'oh.)
2013-12-18 12:09:35 -08:00
David Greenspan
7dab61e50a Fix infinite loop 2013-12-11 23:03:09 -08:00
David Greenspan
7fadc29828 Start to make markdown work; avoid double UI.body 2013-12-11 22:32:48 -08:00
David Greenspan
15f56b4998 Make spacebars-compiler package; server-only
... unless you ask for it by name, in which case it can run on the client.

This means a smaller JS payload in production, without the HTML parser or Spacebars codegen.
2013-12-11 21:41:38 -08:00
David Greenspan
b20119775f rename package "html" -> "html-tools" 2013-12-11 20:14:26 -08:00
David Greenspan
734fecc546 Make package dependencies slightly more accurate 2013-12-11 20:10:05 -08:00
David Greenspan
45bd7f9e73 SVG clock demo 2013-12-11 14:59:55 -08:00
David Greenspan
87921cf178 Redo the HTML representation; needs debugging
Puts HTML.Tag, toHTML, and toJS in the "htmljs" package.
Introduces toText for textareas and attributes.
Changes dynamic attribute representation.
Instances of HTML.Tag, HTML.CharRef, etc. are now "instanceof".

Once this code seems to work, we'll move packages around further.
- "htmljs" is the runtime; can even take out "tocode.js"
- "html-tools" (new package) takes over for "html".

Then, port the tests.
2013-12-09 22:23:27 -08:00