Giter Club home page Giter Club logo

requirejs-tpl's People

Contributors

jkbrzt avatar zeedev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

requirejs-tpl's Issues

optimization inserts whitespaces at beginning and end of function

When using requirejs-tpl with r.js the created functions insert into the produced templates whitespaces at the beginning and at the end of the result.

This can result in some nasty problems depending on your css.

To solve this problem it's sufficient to modify line 53 from

+ "');}return __p.join('');";

to

+ "');}return __p.join('').trim();";

Is this a bug or the intended behaviour ?

PS: Thanks for the great plugin. It is really useful

make work with jakewins/brew maven plugin

Currently having this error, when running mvn brew:optimize:

js: Error: Error evaluating module "undefined" at location "undefined":
Error in file: /.../requirejs.plugins/tpl-0.24.0.js. Conditional comment: //>>excludeStart('excludeTpl', pragmas.excludeTpl)
failed with this error: TypeError: Cannot read property "excludeTpl" from null
fileName:undefined
lineNumber: undefined
http://requirejs.org/docs/errors.html#defineerror (/var/folders/kd/nhdzps716w78sf3nhsgn3mw80000gn/T/build6149642382638994696js#7606)

pom.xml settings looks like this:

        <plugin>
            <groupId>com.voltvoodoo</groupId>
            <artifactId>brew</artifactId>
            <version>0.2.10</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>optimize</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <optimizeSourceDir>${basedir}/src/main/webapp</optimizeSourceDir>
                <optimizeBuildDir>${basedir}/src/main/webapp</optimizeBuildDir>
                <optimizeOutputDir>${basedir}/src/main/webapp</optimizeOutputDir>
                    <!-- Set this to do auto-compilation when a file is changed <watch>true</watch> -->
        </configuration>
        </plugin>

excludeTpl documentation

I just saw the excludeTpl feature in your demo file.

The feature is quite cool and I think you should definitely add a short note to your readme.
pragmasOnSave:{excludeTpl:true}

Not working when doing bundle with java

Everything works fine when using node for bundling, with command:
node build/r-2.0.2.js -o build/booking.build.js

But when doing same with java and rhino like this:
java -classpath build/js.jar:build/compiler.jar org.mozilla.javascript.tools.shell.Main build/r-2.0.2.js -o build/booking.build.js

I get following error:

Tracing dependencies for: booking
TypeError: Cannot call property get in object [object Object]. It is not a function, it is "undefined".
In module tree:
booking
initDom
tpl

TypeError: Cannot call property get in object [object Object]. It is not a function, it is "undefined".
In module tree:
booking
initDom
tpl

I'm using latest version of closure compiler and rhino.
Version of require.js is 2.0.4 and r.js 2.0.2

Not working when bundling with node and r.js later than 2.0.2

Version 2.0.2 of r.js is the latest version which worked with tpl plugin. At least versions between 2.0.3 and 2.0.6 are no more compatible with this plugin.

With version 2.0.6 of r.js I get the following error when compiling with following command:

$ node build/r-2.0.6.js -o build/booking.build.js

Tracing dependencies for: booking
Error: EBADF, Bad file descriptor '/vendor/requirejs.plugins/tpl-0.24.0.js'
In module tree:
    booking
        initDom


Error: EBADF, Bad file descriptor '/vendor/requirejs.plugins/tpl-0.24.0.js'
In module tree:
    booking
        initDom

    at Object.openSync (fs.js:221:18)

[enhancement] Add missing bower.json.

Hey, maintainer(s) of ZeeAgency/requirejs-tpl!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library ZeeAgency/requirejs-tpl is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "ZeeAgency/requirejs-tpl",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Alternative to with(obj||{})

Hi,

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with
"Using with is not recommended, and is forbidden in ECMAScript 5 strict mode."

I was wondering if there is a way to avoid using with as my closure compiler makes 270 verbose warnings about it and it fails in strict mode. Also the lookups needed make the execution slower.

Is there any 'automagic' way of appending the context variable to the references in the template or do you think the only way around this is to manually append a 'special' variable like ctx when referencing variables from the view in the template?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.