Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/blaze-tools/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
parseStringLiteral
} from './tokens';

BlazeTools = {
export const BlazeTools = {
EmitCode,
toJSLiteral,
toObjectLiteralKey,
Expand All @@ -25,5 +25,3 @@ BlazeTools = {
parseExtendedIdentifierName,
parseStringLiteral
};

export { BlazeTools };
25 changes: 25 additions & 0 deletions packages/blaze/blaze.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Blaze } from 'meteor/blaze';

export namespace Meteor {

/** Event **/
interface Event {
type: string;
target: HTMLElement;
currentTarget: HTMLElement;
which: number;
stopPropagation(): void;
stopImmediatePropagation(): void;
preventDefault(): void;
isPropagationStopped(): boolean;
isImmediatePropagationStopped(): boolean;
isDefaultPrevented(): boolean;
}
interface EventHandlerFunction extends Function {
(event?: Event, templateInstance?: Blaze.TemplateInstance): void;
}
interface EventMap {
[id: string]: EventHandlerFunction;
}
/** Event **/
}
7 changes: 7 additions & 0 deletions packages/blaze/dombackend.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// this is necessary because when esbuild chunks things (when using dynamic imports)
// it assumes that every import in that chunk is independent of each other (which is technically correct)
// however, because blaze has an implicit depedency that jquery loads first, this fails.
// this could be fixed more correctly by changing how we generate dependencies.js - but it would be brutal
// it would require that every import be alone in a file with an import to it's predecessor
import "meteor/jquery";

var DOMBackend = {};
Blaze._DOMBackend = DOMBackend;

Expand Down
2 changes: 1 addition & 1 deletion packages/html-tools/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Scanner } from './scanner';
import { parseFragment, codePointToString, getContent, getRCData } from './parse';
import { getComment, getDoctype, getHTMLToken, getTagToken, TEMPLATE_TAG_POSITION } from './tokenize';

HTMLTools = {
const HTMLTools = {
asciiLowerCase,
properCaseTagName,
properCaseAttributeName,
Expand Down
15 changes: 3 additions & 12 deletions packages/observe-sequence/observe_sequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ const isObject = function (value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
const has = function (obj, key) {
var keyParts = key.split('.');

return !!obj && (
keyParts.length > 1
? has(obj[key.split('.')[0]], keyParts.slice(1).join('.'))
: hasOwnProperty.call(obj, key)
);
};

const warn = function () {
if (ObserveSequence._suppressWarnings) {
Expand Down Expand Up @@ -353,12 +344,12 @@ const diffArray = function (lastSeqArray, seqArray, callbacks) {
prevPosition);
}
});

Object.entries(posNew).forEach(function ([idString, pos]) {

var id = idParse(idString);
if (has(posOld, idString)) {

if (Object.hasOwnProperty.call(posOld, idString)) {
// specifically for primitive types, compare equality before
// firing the 'changedAt' callback. otherwise, always fire it
// because doing a deep EJSON comparison is not guaranteed to
Expand Down
2 changes: 1 addition & 1 deletion packages/observe-sequence/package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
summary: "Observe changes to various sequence types such as arrays, cursors and objects",
version: "1.0.20"
version: "1.0.21"
});

Package.onUse(function (api) {
Expand Down
4 changes: 1 addition & 3 deletions packages/spacebars-compiler/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { optimize } from './optimizer';
import { parse, compile, codeGen, TemplateTagReplacer, beautify } from './compiler';
import { TemplateTag } from './templatetag';

SpacebarsCompiler = {
export const SpacebarsCompiler = {
CodeGen,
_builtInBlockHelpers: builtInBlockHelpers,
isReservedName,
Expand All @@ -15,5 +15,3 @@ SpacebarsCompiler = {
_beautify: beautify,
TemplateTag,
};

export { SpacebarsCompiler };