canvas-lms/jest
Evan Battaglia 02af1dfd65 postMessage forwarder iframe: eliminate excess JS
Why:
- The current way of including the forwarder code involves using a
  bundle, All the extra unnecessary Canvas code slows things down, costs
  more to serve, and can cause errors because some things it expects to
  work don't in the iframe.
- This includes the script as a static asset which will be served from
  the CDN and only be refetched by the client when the the script
  content changes, otherwise it will be cached for a year
  (365.2425 days). It will also be gzip-compressed when delivered to
  web browsers.

Credit to Jacob Burroughs for figuring out this approach.

Test plan:
Note: this is pretty much the same test plan as the next commit so you
can test just test that commit.
- after checking out code, run `yarn gulp rev` (this may also be done as
  part of building assets?).
- to make sure you get the new code, clear your browser's cache, load a
  canvas page, and open dev tools. In Network find the (web/doc) request
  for /post_message_forwarding?target=... and visit the page to make
  sure it has the new code (with script
  src="/...lti_post_message_forwarding-1244...js" tag)
- launch an LTI tool and send messages to the forwarder iframe (platform
  storage target) and make sure you get the appropriate response. You
  can use can use messages like:
    {"subject":"lti.put_data","key":"a","value":"b","message_id":"12"}
    {"subject":"lti.get_data","key":"a","message_id":"12"}
- send messages from the tool to the parent window and make sure those
  work too.
- embed an LTI tool in RCE content and while still editing the content,
  send messages from the tool to both the platform storage target and
  the parent window, as in the previous 2 steps.

refs INTEROP-8279
flag=none

Change-Id: I0d4ced28efc3c0c7d8180e72d56bab54557d3cce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334733
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-12-20 22:37:40 +00:00
..
etc rename some things 2021-04-06 01:12:49 +00:00
MockBroadcastChannel.ts opt-in broadcasting with @canvas/query 2023-11-02 16:56:52 +00:00
coffeeTransformer.js Update spec/javascripts/ to latest prettier config 2022-09-29 22:27:11 +00:00
handlebarsTransformer.js Update spec/javascripts/ to latest prettier config 2022-09-29 22:27:11 +00:00
imageMock.js Make core translations and svg imports available in jest 2018-11-29 16:09:47 +00:00
jest-setup.js postMessage forwarder iframe: eliminate excess JS 2023-12-20 22:37:40 +00:00
rawLoader.js Update spec/javascripts/ to latest prettier config 2022-09-29 22:27:11 +00:00
strictTimeLimitEnvironment.js Allow disabling the Jest timeout limit 2023-04-05 20:45:14 +00:00
stubInstUi.js Update spec/javascripts/ to latest prettier config 2022-09-29 22:27:11 +00:00
styleMock.js Use new media attachment route on upload 2023-06-01 21:12:34 +00:00