Skip to content

Commit

Permalink
Merge branch 'master' into HTML_isArray_cross_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
brucejo75 committed Mar 19, 2021
2 parents 2acf08c + a43f702 commit 1835f39
Show file tree
Hide file tree
Showing 31 changed files with 5,136 additions and 116 deletions.
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2

jobs:
test app:
docker:
- image: meteor/circleci:android-28-node-12
steps:
- checkout
- run:
name: "Install Meteor"
command: |
curl https://install.meteor.com/ | sh
- run:
name: "Run Tests"
command: |
cd test-app
pwd
./ci.sh
workflows:
version: 2
Blaze Tests:
jobs:
- test app
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Thumbs.db
db.json
*.log
.idea
test-app/packages
node_modules
package-lock.json
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "tests/test-runner"]
path = tests/test-runner
url = https://github.com/tozd/meteor-test-runner.git
[submodule "site/themes/meteor"]
path = site/themes/meteor
url = https://github.com/meteor/hexo-theme-meteor.git
25 changes: 24 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,27 @@ ln -s /home/user/projects/blaze/packages/blaze-html-templates packages/
...
```

And so on for all the packages.
### Run local tests

The `test-app` folder contains a bare Meteor project you can utilize for local
testing. In order to run local tests, please setup the project first:

#### Setting up the local test environment

Everything is already prepared in scripts:

```bash
$ cd test-app
$ meteor npm install # install dependencies
$ meteor npm run setup # create link to packages
```

This has to be done only once.

#### Run the tests

Simply execute the test script:

```bash
$ meteor npm run test:watch
```
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## vNEXT

## v2.3.4, 2019-Dec-13

* jquery 3 support
[#299](https://github.com/meteor/blaze/pull/299)

## v2.3.2, 2017-Mar-21

* Made beautification of compiled spacebars code happen only on the server.
Expand Down
30 changes: 0 additions & 30 deletions circle.yml

This file was deleted.

86 changes: 48 additions & 38 deletions packages/blaze/.versions
Original file line number Diff line number Diff line change
@@ -1,54 +1,64 @@
allow-deny@1.0.5
babel-compiler@6.14.1
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
blaze@2.3.2
allow-deny@1.1.0
babel-compiler@7.4.1
babel-runtime@1.4.0
base64@1.0.12
binary-heap@1.0.11
blaze@2.3.4
blaze-tools@1.0.10
boilerplate-generator@1.0.11
caching-compiler@1.1.9
boilerplate-generator@1.6.0
caching-compiler@1.2.1
caching-html-compiler@1.1.2
callback-hook@1.0.10
check@1.2.5
ddp@1.2.5
ddp-client@1.3.3
ddp-common@1.2.8
ddp-server@1.3.13
diff-sequence@1.0.7
ecmascript@0.6.3
ecmascript-runtime@0.3.15
ejson@1.0.13
callback-hook@1.2.0
check@1.3.1
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
ddp-server@2.3.0
deps@1.0.12
diff-sequence@1.1.1
dynamic-import@0.5.1
ecmascript@0.13.0
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.9.0
ecmascript-runtime-server@0.8.0
ejson@1.1.0
fetch@0.1.1
geojson-utils@1.0.10
html-tools@1.0.11
htmljs@1.0.11
id-map@1.0.9
id-map@1.1.0
inter-process-messaging@0.1.0
jquery@1.11.10
local-test:blaze@2.3.2
logging@1.1.17
meteor@1.6.1
minimongo@1.0.21
modules@0.7.9
modules-runtime@0.7.9
mongo@1.1.16
mongo-id@1.0.6
npm-mongo@2.2.24
local-test:blaze@2.3.4
logging@1.1.20
meteor@1.9.3
minimongo@1.4.5
modern-browsers@0.1.4
modules@0.14.0
modules-runtime@0.11.0
mongo@1.7.0
mongo-decimal@0.1.1
mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-mongo@3.2.0
observe-sequence@1.0.16
ordered-dict@1.0.9
promise@0.8.8
random@1.0.10
ordered-dict@1.1.0
promise@0.11.2
random@1.1.0
reactive-var@1.0.11
retry@1.0.9
routepolicy@1.0.12
reload@1.3.0
retry@1.1.0
routepolicy@1.1.0
socket-stream-client@0.2.2
spacebars@1.0.15
spacebars-compiler@1.1.2
templating@1.3.2
templating-compiler@1.3.2
templating-runtime@1.3.2
templating-tools@1.1.2
test-helpers@1.0.11
tinytest@1.0.12
tracker@1.1.2
ui@1.0.12
test-helpers@1.1.0
tinytest@1.1.0
tracker@1.2.0
underscore@1.0.10
webapp@1.3.14
webapp@1.7.5
webapp-hashing@1.0.9
4 changes: 1 addition & 3 deletions packages/blaze/attrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ var StyleHandler = Blaze._DiffingAttributeHandler.extend({
tokens.remove(match[1]);
}

// XXX No `String.trim` on Safari 4. Swap out $.trim if we want to
// remove strong dep on jquery.
tokens.append(match[1], match[0].trim ? match[0].trim() : $.trim(match[0]));
tokens.append(match[1], match[0].trim());

match = regex.exec(attrString);
}
Expand Down
7 changes: 4 additions & 3 deletions packages/blaze/package.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Package.describe({
name: 'blaze',
summary: "Meteor Reactive Templating library",
version: '2.3.2',
version: '2.3.4',
git: 'https://github.com/meteor/blaze.git'
});

Package.onUse(function (api) {
api.use('jquery@1.11.9'); // should be a weak dep, by having multiple "DOM backends"
api.use('jquery@1.11.9 || 3.0.0', { weak: true }); // should be a weak dep, by having multiple "DOM backends"
api.use('tracker@1.1.0');
api.use('check@1.2.3');
api.use('underscore@1.0.9');
api.use('observe-sequence@1.0.12');
api.use('reactive-var@1.0.10');
api.use('ordered-dict@1.0.9');
api.use('ecmascript@0.12.7');

api.export([
'Blaze',
Expand Down Expand Up @@ -50,7 +51,7 @@ Package.onUse(function (api) {
Package.onTest(function (api) {
api.use('tinytest@1.0.11');
api.use('test-helpers@1.0.10');
api.use('jquery@1.11.9'); // strong dependency, for testing jQuery backend
api.use('jquery@1.11.9 || 3.0.0'); // strong dependency, for testing jQuery backend
api.use('underscore@1.0.9');
api.use('reactive-var@1.0.10');
api.use('tracker@1.1.0');
Expand Down
77 changes: 60 additions & 17 deletions packages/blaze/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,24 +449,67 @@ Template.prototype.helpers = function (dict) {
this.__helpers.set(k, dict[k]);
};

// Kind of like Blaze.currentView but for the template instance.
// This is a function, not a value -- so that not all helpers
// are implicitly dependent on the current template instance's `data` property,
// which would make them dependenct on the data context of the template
// inclusion.
Template._currentTemplateInstanceFunc = null;

Template._withTemplateInstanceFunc = function (templateInstanceFunc, func) {
if (typeof func !== 'function')
throw new Error("Expected function, got: " + func);
var oldTmplInstanceFunc = Template._currentTemplateInstanceFunc;
try {
Template._currentTemplateInstanceFunc = templateInstanceFunc;
return func();
} finally {
Template._currentTemplateInstanceFunc = oldTmplInstanceFunc;
var canUseGetters = function() {
if (Object.defineProperty) {
var obj = {};
try {
Object.defineProperty(obj, "self", {
get: function () { return obj; }
});
} catch (e) {
return false;
}
return obj.self === obj;
}
};
return false;
}();

if (canUseGetters) {
// Like Blaze.currentView but for the template instance. A function
// rather than a value so that not all helpers are implicitly dependent
// on the current template instance's `data` property, which would make
// them dependent on the data context of the template inclusion.
var currentTemplateInstanceFunc = null;

// If getters are supported, define this property with a getter function
// to make it effectively read-only, and to work around this bizarre JSC
// bug: https://github.com/meteor/meteor/issues/9926
Object.defineProperty(Template, "_currentTemplateInstanceFunc", {
get: function () {
return currentTemplateInstanceFunc;
}
});

Template._withTemplateInstanceFunc = function (templateInstanceFunc, func) {
if (typeof func !== 'function') {
throw new Error("Expected function, got: " + func);
}
var oldTmplInstanceFunc = currentTemplateInstanceFunc;
try {
currentTemplateInstanceFunc = templateInstanceFunc;
return func();
} finally {
currentTemplateInstanceFunc = oldTmplInstanceFunc;
}
};

} else {
// If getters are not supported, just use a normal property.
Template._currentTemplateInstanceFunc = null;

Template._withTemplateInstanceFunc = function (templateInstanceFunc, func) {
if (typeof func !== 'function') {
throw new Error("Expected function, got: " + func);
}
var oldTmplInstanceFunc = Template._currentTemplateInstanceFunc;
try {
Template._currentTemplateInstanceFunc = templateInstanceFunc;
return func();
} finally {
Template._currentTemplateInstanceFunc = oldTmplInstanceFunc;
}
};
}

/**
* @summary Specify event handlers for this template.
Expand Down
7 changes: 5 additions & 2 deletions packages/caching-html-compiler/caching-html-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ CachingHtmlCompiler = class CachingHtmlCompiler extends CachingCompiler {
// Overrides method from CachingCompiler
processFilesForTarget(inputFiles) {
this._bodyAttrInfo = {};
super.processFilesForTarget(inputFiles);
return super.processFilesForTarget(inputFiles);
}

// Implements method from CachingCompilerBase
getCacheKey(inputFile) {
// Note: the path is only used for errors, so it doesn't have to be part
// of the cache key.
return inputFile.getSourceHash();
return [
inputFile.getArch(),
inputFile.getSourceHash(),
];
}

// Implements method from CachingCompiler
Expand Down
2 changes: 1 addition & 1 deletion packages/caching-html-compiler/package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package.describe({
name: 'caching-html-compiler',
summary: "Pluggable class for compiling HTML into templates",
version: '1.1.2',
version: '1.1.3',
git: 'https://github.com/meteor/blaze.git'
});

Expand Down
4 changes: 2 additions & 2 deletions packages/spacebars-tests/old_templates_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1393,11 +1393,11 @@ Tinytest.add("spacebars-tests - old - template_tests - radio", function(test) {
var btns = nodesToArray(div.getElementsByTagName("INPUT"));
var text = function () {
var text = div.innerText || div.textContent;
return text.replace(/[ \n\r]+/g, " ");
return text.replace(/[ \n\r]+/g, " ").replace(/^\s+|\s+$/g, "");
};

test.equal(_.pluck(btns, 'checked'), [false, false, false]);
test.equal(text(), "Band: ");
test.equal(text(), "Band:");

clickIt(btns[0]);
test.equal(change_buf, ['AM']);
Expand Down
2 changes: 1 addition & 1 deletion packages/spacebars-tests/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Package.onTest(function (api) {
'es5-shim@4.6.14',
'underscore@1.0.9',
'tinytest@1.0.11',
'jquery@1.11.9',
'jquery@1.11.9 || 3.0.0',
'test-helpers@1.0.10',
'reactive-var@1.0.10',
'markdown@1.0.10',
Expand Down
Loading

0 comments on commit 1835f39

Please sign in to comment.