Comments (6)
I've been looking at this, and have a few comments/issues:
We are currently chaining together a number of steps for the javascript to reach the final tmp/public/assets/app.js
:
copy:prepare
copies fromapp/**/*.js
totmp/javascript/app/
transpiler
transpiles fromtmp/javascript/app/**/*.js
totmp/transpiled/app/
emberTemplates:compile
compiles templates fromapp/templates/
totmp/public/assets/templates.js
concat
concats all JS from- Then additionally for final release we do these tasks:
uglify
compresses the files identified byuseminPrepare
rev
prepends a hash to the files generated by uglify
In order for our source maps to point back to our original code in app/
we will need each step in the chain to support source maps. (This means that we will have to pass a source map input for everything but the original step.)
Issues with source map support in the current build chain:
- It doesn't look like es6-module-transpiler supports source maps at this point (although I could have missed it). I am looking to see if I can add support using the mozilla/source_map module.
- We need to create a source map during the
copy:prepare
task (coffeescript can already generate a source map on compile) so that we can pass it in to thetranspile
task. grunt-contrib-concat
doesn't support source maps either. There is an alternate that we could use atgrunt-concat-sourcemap
, but I'm not sure if we want to depend on an external dependency that isn't maintained by the Grunt team...
Another alternative would be to use uglify
instead of concat
since uglify
supports source map in/out and what not. We could tweak the options so that it wouldn't 'mangle' on a standard build (only on build:dist
). How do we feel about this in general?
If we either use grunt-concat-sourcemap
or uglify
to concat, then our only issues are the copy:prepare
and es6-module-transpiler
.
from ember-app-kit.
Would it be sufficient first step to add source maps to a step at a time? For example, just before the concat/uglify step so that you can at least debug individual modules in dev?
from ember-app-kit.
Going to attempt to include source maps for transpiling during the big Esprima refactor i'm doing. most of it is line-to-line so shouldn't be too bad (knock on wood)
After that, main issue for source maps is concat. grunt-concat-sourcemap should be merged into grunt-contrib-concat ASAP, but in the meantime we may just want to use grunt-concat-sourcemap instead. However, it doesn't currently support piping in existing source maps AFAIK, so that'll have to be added.
from ember-app-kit.
Added grunt-concat-sourcemap support in 580525d. Result looks like this:
Better than debugging a single concatenated file, at least.
from ember-app-kit.
@thomasboyt absolutely, this much better then what we had before. At some point having 1:1 would be great, but this is already a great leap forward.
That being said, I'll leave this issue open until we have the 1:1 solution.
from ember-app-kit.
i think leaving the current solution is fine, turns out having debugged a few things. Being able to see the module system preamble, has actually helped me sort or module related issues on many occasions.
I think this can be improved, but for now this seems totally fine.
from ember-app-kit.
Related Issues (20)
- Does EAK Support Inheritance With Controllers? HOT 3
- Suggestion: Defer loading of JavaScript HOT 1
- Recommended Folder Structure Using EAK HOT 4
- Migrating to Ember-CLI HOT 17
- Deploying to a non-root directory HOT 3
- Trouble with NPM scripts HOT 1
- 'grunt test:server' not work HOT 1
- Extending Store In EAK HOT 4
- EAK: Where do we place {{partials}} ? HOT 2
- ./config/environment.js example HOT 7
- `Cannot find module..." HOT 3
- Migrating to Ember-CLI Screencast HOT 2
- Importing shared ES6 modules futuristically HOT 2
- Added bootstrap-sass-official, Now Can't Push to Heroku HOT 2
- Stub API not working with server:dist task
- Transition into the loading substate
- Allow Ember Init and Generate for Coffeescript HOT 1
- Production build failed (grunt:dist) on fresh clone of EAK HOT 1
- Cannot deploy the 'ember app kit' app to heroku
- Update Ember CLI Migration Guide HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-app-kit.