wheee regexes
spec/javascripts/jsx/speed_grader/mgpSpec.jsx was breaking :allthethings:
cuz 1. require and 2. multiline. now we allow those, cuz why not
test plan:
1. js specs should still pass under requirejs
2. js specs should now pass under webpack
Change-Id: I039991bcb8fd5afd25ffa1ede487bd3691848761
Reviewed-on: https://gerrit.instructure.com/91196
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
closes: CNVS-31940
This is to try to not break code of our customers
that use RequireJS-style `require`s in their Custom
JS files from ThemeEditor. It is not meant to be
comprehensive. There will be some customers that
need to change their code, but there was a lot that
just used require to load jquery or just load an
external script. this should handle both of those cases.
test plan:
* with webpack turned on, type this into the console:
require([
'underscore',
'jquery',
'https://code.jquery.com/color/jquery.color.js'
], function(_, $) {
console.log('got', $, _, $.Color.names)
})
* it should log underscore, jquery and the colors
Change-Id: I88ad111ac6c475c9bb0987ed98bec10417a6eea0
Reviewed-on: https://gerrit.instructure.com/90379
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
test plan:
* before checking this out, run:
NODE_ENV=production npm run webpack-production
* check the size of the common bundle with:
ls -lah public/webpack-dist-optimized/instructure-common.bundle.js
* check this out and run it again
* the size of that file should now be smaller
Change-Id: Ice764700e75c2a793b2807b6a77e30fa7b2f2c25
Reviewed-on: https://gerrit.instructure.com/90432
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
closes: CNVS-29725
this gets everything working on node 6.
As far as our build process goes, it cannot support
running on both node 6 at the same time as 0.12
since our i18nliner handlebars stuff uses jsdom and
one version of it only works on node <4 and the
next only works on 4+.
But the stuff in the production dependencies in
package.json, aka the stuff that runs on the job
servers (brandable_css), can work on both. we just
need to run npm rebuild on the job servers if the stuff
that was npm installed into ./node_modules was compiled
against a different version of node. that is done here:
https://gerrit.instructure.com/81254
that commit needs to be committed to caturday before
we commit and deploy this to beta
as far as managing node, there are 2 "official"
ways that will make you life easier, you can either
just use docker or use nvm (https://github.com/creationix/nvm)
if you use nvm and if you use ZSH:
Put this into your $HOME/.zshrc to call nvm use automatically
whenever you enter a directory that contains an
.nvmrc file with a string telling nvm which node to use:
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
elif [[ $(nvm version) != $(nvm version default) ]]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
but however you do it, as long as you have node 6.2
installed it should work
test plan:
* install nvm
* check this patchset out
* run bundle exec rake canvas:compile_assets
* it should work
* use theme editor to preview a change to a theme
* it should work
Change-Id: I1cc9faed361938afc713c4b921042386b956db70
Reviewed-on: https://gerrit.instructure.com/80839
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
closes: CNVS-30472
since client_apps/canvas_quizzes is the only
thing that cares about our old version of
react and react-router, this moves them out
of canvas and into canvas_quizzes so it is the
only one that can use them. This simplifies
things in canvas so no one ever tries to
use them going forward.
test plan:
* inside of client_apps/canvas_quzzes
run: `script/build && grunt test`
* it should pass jenkins
* click around in the quiz stats and quiz log
auditing apps to make sure they still load
mv old_unsupported
Change-Id: I56eadedfe2417f32f2afb99ec76a21870871ad7e
WIP move "old_unsupported_react" to client_apps
Change-Id: I673321b51db9b197a298ccb831c417e902aaae28
Reviewed-on: https://gerrit.instructure.com/85483
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
This keeps quiz_statistics using the underscore compatible
version of lodash 2.4.1 in which exists _.findWhere rather than
using the new 4.x version of lodash recently added.
closes CNVS-30750
Test Plan:
- Post-merge and silent patchset builds for selenium webpack pass
Change-Id: I4f63aa431e29b77dd46dad4a9828afe10e84ef85
Reviewed-on: https://gerrit.instructure.com/86007
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
For some reason some plugins like analytics have specs that
live in `spec_canvas/coffeescripts` it seems that webpack never
properly picked those up and complained about it in warnings.
Test Plan:
- Webpack tests pass
Change-Id: I1c84f6850aa0501a5659aabde7768257e97a9253
Reviewed-on: https://gerrit.instructure.com/78723
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
This fixes it post 4f547f345b
Test Plan:
- Webpack builds without complaining about it
Change-Id: Ie6d58a3d9ac4b1c9ee4b8a1075c57321c630a3c7
Reviewed-on: https://gerrit.instructure.com/82473
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
fixes CNVS-28474
From what I could tell, none of the hbs templates were being passed the
`scope` value as part of the helper method `options.hash`, and that's
because we were not using the preprocesses that
PreProcessor.processStatement override via
frontend_build/i18nLinerHandelbars.js.
test plan:
- Load canvas using the Webpack build.
- Go into Calendar.
- Click on a day in the month and a Edit Event modal should pop up.
- Observe that the `Date:` labem is present, whereas it used to say
[object Object].
Change-Id: I8e077261379b43f5be27ab6544d9d05a47e97625
Reviewed-on: https://gerrit.instructure.com/81558
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Fixes PLAT-1564
Test Plan
- With the new collaboration feature flag turned on
- For a user, create some collaborations with the
collaboration_type=external_tool_collaboration
- Load the lti_collaborations page
- Notice that collaboration now shows
Change-Id: Ie17a599fa4b54a98eff7060c2c72b2c76c242b3d
Reviewed-on: https://gerrit.instructure.com/81645
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matthew Sessions <msessions@instructure.com>
Previous to this change if the callback only contained
'$' or '_' as variables to hold the required dependency,
it was not detected and qunit was not injected properly
fixes CNVS-29207
Test Plan:
- Automated tests pass that contain only $
- Normal automated tests pass
Change-Id: I22d9cb390bfc1f0b579577dc7bec2de40fd5dc3f
Reviewed-on: https://gerrit.instructure.com/79017
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
closes: CNVS-28669
refs: CNVS-28781
Back in 2013 we came up with an awesome idea to have these
"Tours" to introduce new features and stuff. It was a
great idea but we don't use it anymore. it has been commented
out so it doesn't show up in the styleguide and all but one
(see below) were commented out of config/tours.rb.
so in the interest of not letting code hang around
that we don't use, I'm removing it (unless anyone is opposed
or has a good reason to leave it). If we want to do it in the
future, we can just add it back, because yay Git!
There was one place in quizzes that was still trying to
use a tour. if you go to create a quiz and edit a question
and then pick another option as the correct answer for a
multiple choice question it would try to show a tour telling
you that you could regrade all the existing submissions. but
in reality it just threw a javascript error and the tour never
popped up. So even though it was still in the code, it didn't
work. Since no one noticed that it stopped working, I'm assuming
we don't need it any more. Quizzes team and quizzes
product/QA, will you confirm this is ok?
test plan:
* no tours should show up anywhere in canvas
* read that paragraph above about the "regrade existing"
thing in quizzes.
* try that feature, it should work but no tour should show up
and no error should occur in the console
Change-Id: Ib2d6bbb80f93fd7ca0a33d20c1f57ee16e7027ea
Reviewed-on: https://gerrit.instructure.com/76875
Tested-by: Jenkins
Reviewed-by: Jennifer Stern <jstern@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
refs: CNVS-27874
TEST PLAN:
1) run webpack build
2) should be fast
3) load the calendar page
4) all the styles should look good
Change-Id: I28d9205fbf53616ed9264d8393dc617962e43c22
Reviewed-on: https://gerrit.instructure.com/74197
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
This follows up to f725bcf813
by also removing it from the webpack build.
Test Plan:
- The webpack build works still
Change-Id: I43aa82c129aa9dbf5bf4d4e4928f39701af147a8
Reviewed-on: https://gerrit.instructure.com/75887
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
it was just a bundle that required another bundle
the only place we used this calendar2.
this just removes the step of indirection and
simplifies things so we don't have to do extra work
to workaround it in webpack
refs: CNVS-27679
test plan:
in prod env, go to calendar2
do some things that cause modals to open
it should work
do the same with webpack on
Change-Id: I23fc7836e1def8283d582df98f895cdc6d8f1317
Reviewed-on: https://gerrit.instructure.com/73242
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
This makes it so using async test features of qUnit works within
the JSX specs.
Change-Id: I602468d7ef70091e603f02bc9558390b94c0bfee
Reviewed-on: https://gerrit.instructure.com/74527
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
This makes it so that multi-line define statements work with
the qunit dep loader for jsx.
Prior to this commit
```
define([
'jsx/account_course_user_search/reducers/rootReducer'
], (reducer) => {
```
is not properly transformed, however
```
define(['jsx/account_course_user_search/reducers/rootReducer'], (reducer) => {
```
does get transformed properly.
Effectively, this replaces the `.` regex operator which doesn't transend
newlines with `[\s\S]` which effectively does the same thing
including newlines as well though.
Change-Id: Ife96438695997050fbdf866b7c319fa1b075875a
Reviewed-on: https://gerrit.instructure.com/74419
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
refs: CNVS-27679
if you name your config files *.config.babel.js
webpack knows to run them through babel. this change
makes it so use es6 stuff in the webpack.config files
(including everything in /frontend_build)
test plan:
run webpack
it should work
Change-Id: I6ceda3386227c30e106339f744f18dc61bbab54b
Reviewed-on: https://gerrit.instructure.com/73241
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
closes CNVS-27874
TEST PLAN:
1) run webpack build
2) should be fast
Change-Id: I3d0b07cb7417cbd235bd628375d9888c6cc8d090
Reviewed-on: https://gerrit.instructure.com/74112
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
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>
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>
refs CNVS-25916
Replicate old require-js plugin behavior
for making sure contextual timezone and locale
information is loaded before any other modules
depend upon it.
TEST PLAN:
1) grading_periods_account_spec should pass in
webpack selenium build
Change-Id: I46871b15e803e551149d344922f1679906873c54
Reviewed-on: https://gerrit.instructure.com/70553
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
the migration_tool plugin uses the secondary
bundle override technique of having an extension
bundle loaded in parallel. I don't think we
want to support both that and the glue-module
extension approach since only one plugin makes
use of the former. In order to migrate that
work to extend a core module, the work
needs to be moved to a non-entry-point
module (because overriding require names doesn't
work if you're talking about the bundles
rails knows how to load). All this patchset does
is move the core work done in the content_migration
bundle into it's own module to make a valid
override target for the plugin refactor.
Also adds this new module as a non-entry-point
exception in the bundles.js, just like it's sibling
file.
TEST PLAN:
1) nothing should change on /courses/x/content_migrations
Change-Id: I2dfa0d1b1d11657bb5931e8caae6ef9d4b3c9aec
Reviewed-on: https://gerrit.instructure.com/70510
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
the "app" directory as root is only present for docker users.
we can just remove it from the matchers for jsx loaders
and then these work on jenkins too.
TEST PLAN:
1) spec/selenium/quizzes/quizzes_stats_spec should pass in selenium
webpack build
Change-Id: I51f915452de5f4a3f98407d6e3b90a4b18a8671e
Reviewed-on: https://gerrit.instructure.com/70292
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
alias case-sensitive file names so they build
the same on Linux as OS-X
Change-Id: Ib36193d7f7a6c3f77e4eac6e5650ea549747b957
Reviewed-on: https://gerrit.instructure.com/70203
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
Use an AMD-rewritten version of old react-router
and expose some of reacts internals that
react-router depends on (named AMD across files
is something web pack does not support), and leave
the other version for the require-js build for now.
Also, add gulp rev as a web pack post build action.
TEST PLAN:
1) regression check QLA and Quiz Stats
to make sure reworking their dependencies didn't
crash everything
Change-Id: Id2b448a334494ebd3d353678742bf07c1b7833eb
Reviewed-on: https://gerrit.instructure.com/69837
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
remove dynamic requirements for env configs,
use separate jsx loader for client apps,
update client app plugin to use old react version,
rewrite selenium spec to be an integration test
rather than executing arbitrary javascript,
and MAJORLY refactor loading patterns of client apps
to avoid sharing code with differences delineated
by opaque require re-writes.
Also moved some code that was in "common" client
app but only used by one actual client app down
into the app that uses it (simplifies dependency
tracing).
TEST PLAN:
1) make sure quiz statistics still works ok under
require js build, no behavior should have changed
2) also make sure quiz log auding works under require-js
Change-Id: I0e5ee3eda9da16e0ad48cf858761735c71df801c
Reviewed-on: https://gerrit.instructure.com/69804
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
This prevented non-docker installs from web packing
correctly, unless they happened to be inside
a directory called "app".
TEST PLAN:
1) nothing should change, no production code impact
Change-Id: Ice89ed1295e0502bc9d6cc432767f371a1a53b83
Reviewed-on: https://gerrit.instructure.com/70016
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
refs CNVS-25916
newly added bundles are being missed.
Look for bundles in "app/coffeescripts/bundles"
and reject those which are not entry points.
TEST PLAN:
1) specs should pass
2) web pack selenium build should have less failures
Change-Id: I7562e4f6124a78b62cdd59151067ce31ac65e164
Reviewed-on: https://gerrit.instructure.com/69311
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
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>
closes CNVS-24966
change js specs to work with web pack.
update some dependency references, make some aliases
for external dependencies to get the right version,
and clean up a bunch of leaky state.
TEST PLAN:
js tests should pass in web pack _and_ requires
Change-Id: If37fbce93e7e67021d90bacb470ffc4f1b17402d
Reviewed-on: https://gerrit.instructure.com/66309
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
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>