Changes to allow marko v3 compiler to work in the browser

This commit is contained in:
Patrick Steele-Idem 2016-03-02 17:03:30 -07:00
parent 864c168368
commit 186e5fca03
8 changed files with 60 additions and 4 deletions

8
compiler/browser.json Normal file
View File

@ -0,0 +1,8 @@
{
"dependencies": [
"../taglibs/async/browser.json",
"../taglibs/core/browser.json",
"../taglibs/html/browser.json",
"../taglibs/layout/browser.json"
]
}

View File

@ -1,12 +1,12 @@
/*
* Copyright 2011 eBay Software Foundation
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -22,5 +22,11 @@ function excludeDir(dirname) {
// no-op
}
function clearCache() {
// no-op
}
exports.find = find;
exports.excludeDir = excludeDir;
exports.excludeDir = excludeDir;
exports.clearCache = clearCache;

View File

@ -0,0 +1,5 @@
{
"browser": {
"./client-reorder.js": "./client-reorder-browser.js"
}
}

5
taglibs/cache/browser.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"dependencies": [
"require: *.js"
]
}

View File

@ -0,0 +1,5 @@
{
"dependencies": [
"require: *.js"
]
}

View File

@ -0,0 +1,17 @@
'use strict';
module.exports = function codeGenerator(el, codegen) {
let argument = el.argument;
if (!argument) {
return;
}
let builder = codegen.builder;
let pathExpression = builder.parseExpression(argument);
if (pathExpression.type !== 'Literal' || typeof pathExpression.value !== 'string') {
codegen.addError('Argument to the <include-text> tag should be a string value: <include-text("./foo.txt")/>');
return;
}
var path = pathExpression.value;
return builder.text(builder.literal('<include-text> cannot be compiled in the browser (path="' + path + '")'));
};

View File

@ -0,0 +1,5 @@
{
"browser": {
"./include-text-tag.js": "./include-text-tag-browser.js"
}
}

View File

@ -0,0 +1,5 @@
{
"dependencies": [
"require: *.js"
]
}