Commit Graph

13 Commits

Author SHA1 Message Date
decaffeinate f5e4bc2d80 [spec][decaffeinate] convert coffe specs to js syntax
...and pass them through amdtoes6, eslint, and prettier

This converts most of our coffeescript spec files to javscript, to
es module syntax and applies our eslint code formatting rules to it.

Because this is just spec files, as long as the tests still run
and they all still pass, this should be good. That makes these a lot
easier and safer to deal with converting than the stuff in
app/coffeescripts

After this commit there should not be any .coffee files in the
/spec/ directory.

test plan:
* jenkins should run the same # of js specs as before and they should
  all pass

Change-Id: I701c101777486e2e37d0ec1327692f16099352cd
Reviewed-on: https://gerrit.instructure.com/141556
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-02-22 16:45:17 +00:00
Ryan Shaw baa5568f37 Make it so you can use js in app/coffescripts
closes:  CNVS-37356

in order to help the transition away from coffeescript, this makes
it so you can just change the file extension of a file in 
app/coffeescripts from .coffee to .js and convert it to js syntax.
the big win is that you won't have to change the 'require' path to it
in all the modules that were consuming it.

test plan:

* check out g/114236, it converts a bunch of files to .js and uses this
* yarn test and yarn run webpack should work

Change-Id: Ie4e22153c419bb92ebef66fb8dae196db08ff583
Reviewed-on: https://gerrit.instructure.com/114234
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-06-07 16:27:18 +00:00
Landon Wilkins 1649b7e30c da licença part 51
add consistent license headers to all source files

Change-Id: Ie6f2d48e5615052512ee19bf090bcd06bcb8e11f
Reviewed-on: https://gerrit.instructure.com/110162
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 19:05:00 +00:00
Ryan Shaw e93e2c4cb8 Don't add .handlebars ext if already present
closes: CNVS-36235

this is needed by g/108094. it makes it so plugins don't need to rely
on any of our custom loaders to load their handlebars templates

test plan:
* build should pass
* analytics pages that use handlebars templates should load as 
  they did before

Change-Id: Ic4f91ec9fc1f5dd6bd97fb74a67ba760fc14b13c
Reviewed-on: https://gerrit.instructure.com/108145
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-04-11 15:37:22 +00:00
Ryan Shaw db04f0b3c5 rename all .jsx files to .js
fixes: CNVS-34727

this will make webpack faster because it cuts down
the number of files it has to look for when
it looks a module up. right now, every time
someone asked for a app/jsx/whatever.jsx file
it had to do a stat for app/jsx/whatever.js first
and then look for app/jsx/whatever.jsx. it also
slows every lookup for handlebars/coffescript files
since it has to look for the jsx first

this was just the result of running this command:
find . -type f -name "*.jsx" | while read FNAME; do git mv "$FNAME" "${FNAME//.jsx/.js}"; done

test plan:
* automated specs should pass
* webpack build should run faster than the patchset
  before this one

Change-Id: Ia15ded6dc2b09c10c4f9070edcee9305b5b429ad
Reviewed-on: https://gerrit.instructure.com/101005
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-16 20:22:15 +00:00
Ryan Shaw 32f20ed70d [webpack] add happypack to make build faster
closes: CNVS-31791

test plan:
* automated tests should pass on jenkins
* webpack build should be considerably faster

Change-Id: I3583c92e2bbff5fbbd441853e33057603564601d
Reviewed-on: https://gerrit.instructure.com/100903
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-11 23:36:02 +00:00
Ryan Shaw e9c83d18e7 don’t try to load quiz web worker from a different origin
in webpack, it would try to load the web worker from the
cdn configured in canvas_cdn.yml. it is against browser
security rules to open a web worker on a different origin,
so in production/beta it would not load and the page to take a quiz
would not load at all. It worked in requireJS because
it didn’t actually know to load the worker from the con
and since it just loaded it from the same domain the page
was served from, it did not have that problem.

this fix just inlines the web worker into a blob and
loads it itself, so there is no cross-origin problems
and we don’t have to have a requireJS or webpack plugin
to load web workers. 

also, fix bug where webpack looked for compiled 
version of quiz_taking_police

fixes: CNVS-34349
fixes: CNVS-34386

test plan:

using the CDN setup for dev/testing

in both webpack and requireJS
go to take a quiz,
the stopwatch should tick every second

Change-Id: I31e6ea0cd22d8dff8c8cb46c68e78d3f5c1989c0
Reviewed-on: https://gerrit.instructure.com/99521
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2017-01-24 00:51:32 +00:00
Ryan Shaw 951e7060b1 apply standard formatting to ./frontend_build JS code
closes: CNVS-33810

because this is code that runs on node 6, we can
actually rely on all our es2015 "best practices".
this change was because the code in this folder had a bunch
of different styles and incosistencies, and I wanted to clean it
up while I am working on all this webpack stuff before we turn
it on everywhere.

this is basically the result of running:
npm install -g jscodeshift
cd ..
git clone https://github.com/cpojer/js-codemod.git
jscodeshift -t js-codemod/transforms/arrow-function.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/no-vars.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/object-shorthand.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/template-literals.js canvas-lms/frontend_build
jscodeshift -t js-codemod/transforms/trailing-commas.js canvas-lms/frontend_build
npm install -g standard-format
cd canvas-lms/frontend_build
standard-format -w

Change-Id: Ifb347a5577504dbca6402ad3ec71de2ec58a423a
Reviewed-on: https://gerrit.instructure.com/92166
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-12-12 19:10:26 +00:00
Ethan Vizitei 35c84fc95f webpack: use handlebars source
closes CNVS-27767

it’s the same reason as jsx was added here.
we compile handlebars templates to public/jst/etc
which matches to the same require path
so if you require “jst/wiki/WikiPageEdit”, it will grab the requirejs
pre-compiled version rather than the handlebars source
so watch doesn’t pickup changes to the handlebar template

TEST PLAN:
 1) build with webpack
 2) make a handlebars change
 3) webpack picks it up

Change-Id: I57e89652a43d3046a71b5779ffff883907da2b14
Reviewed-on: https://gerrit.instructure.com/73794
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-03-08 17:02:56 +00:00
Ethan Vizitei 2329d50839 stop webpack from loading js-from-jsx
the artifacts generated by the requirejs build can
be picked up by webpack, we need to make sure that
doesn't happen to allow webpack to find changes as you work.

Change-Id: I8df9ca16105eb8f179b82111ebc516de0410226d
Reviewed-on: https://gerrit.instructure.com/72121
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-02-12 18:18:31 +00:00
Ethan Vizitei da9a226eb4 make webpack able to digest jsx from plugins
Also don't parse the react bootstrap table plugin, it's already
a prebuilt thing that doesn't require other things.

Change-Id: Ibdc06483afc22fe53d08a50892ac2d1322d759e2
Reviewed-on: https://gerrit.instructure.com/71646
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2016-02-06 23:37:44 +00:00
Ethan Vizitei 765507f63e several things to help webpack compile speed
closes CNVS-25714

TEST PLAN:
web pack should compile in like 60 seconds rather than 600

Change-Id: I74716d9cccfd0253693660c0b4ad4368e91b72e7
Reviewed-on: https://gerrit.instructure.com/68497
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-12-09 19:25:30 +00:00
Ethan Vizitei d7f61d1820 use web pack
closes CNVS-24124

makes working with web pack possible in canvas
instead of require-js.  See doc/working_with_webpack.md
for instructions.

TEST PLAN:
Nothing should change in non-webpack'd behavior
Things should mostly work when you use the
USE_WEBPACK environment variable, but make sure to document
and ticket things that don't

Change-Id: I493a259a609e9e183950bc57aa5876df70108547
Reviewed-on: https://gerrit.instructure.com/64386
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-11-02 16:27:14 +00:00