Code Monkey home page Code Monkey logo

Comments (5)

rupakg avatar rupakg commented on September 18, 2024

I just feel that workflow should be like this:

  1. Use Ti Generator to gen a project.
  2. Run Rakefile which is part of the generated project, to compile, build and deploy the project.
  3. Iteratively, use Ti generator to gen views etc.
  4. Run Rakefile to compile, build and deploy.

Here is what Wynn had changed with the paths for compiling Coffeescripts:

def compile_coffee puts "Compiling CoffeeScript".blue paths =find src/#{@ticonfig.name} -name '*.coffee'`.split("\n")
compilation = (
system "coffee -p --join --bare #{paths.join(' ')} > Resources/#{@ticonfig.name.downcase!}.js" and
system "coffee -p --bare src/app.coffee > Resources/app.js"
)

if compilation
puts "Successfully compiled CoffeeScript".green
else
puts "Error compiling CoffeeScript".red
end
compilation
end
`

Take a look and let me know what you think. I personally feel getting the compile options (coffeescript/sass) inside Ti, limits the flexibility of how the user wants to compile the sass/coffeescript files. We are providing source code in sass/coffeescript and hence we should allow the user to make a choice of how to compile it. If tomm. things change with these tools, we don't want to chase them and have Ti coupled with them. Just my 2 cents.

from ti.

revans avatar revans commented on September 18, 2024

I disagree.

The above does not solve the problem of compiling coffee-scripts in specific order and puts the problem on the developer to figure out a clean solution for doing so.

Ti should provide this solution out of the box, which is does now, with the Ti::Compiler::CoffeeScripts. The process is the same process for importing sass files, which most developers are now used to. Sprockets follows this as well.

from ti.

baldrailers avatar baldrailers commented on September 18, 2024

Check the implementation: https://github.com/codewranglers/Ti/commit/ba88674320f2ff4bb517b8f1db3d8b3ffc1c5d7a

from ti.

baldrailers avatar baldrailers commented on September 18, 2024

I've noticed that there's a big difference between the compiled js from the original Rakefile and Ti::Compiler::CoffeeScripts

Ti::Compiler::CoffeeScripts is using execjs to output the js file, thus with coffeescript is different. The coffee-script ruby compiler that we are using in ti lacks other option which is very critical for compiling the js here are the compilation options that are missing from the coffee-script gem

-j, --join concatenate the scripts before compiling

I'm thinking of building another compiler or just patching the gem that we are using to have that option in.

Thoughts?

from ti.

revans avatar revans commented on September 18, 2024

I've pushed an update to address this. Did a diff using both versions (ti compile && rake compile) and there is no difference now.

from ti.

Related Issues (20)

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.