Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from electron-protocol-serve to file: URLs #476

Merged
merged 4 commits into from
May 21, 2020
Merged

Commits on May 21, 2020

  1. Simplify test setup

    In ember-electron 2.x, the `electron:test` command would build the Ember app into a temp location somewhere, so we'd have to jump through a bunch of hoops to pass that location to the Electron app so it could load the Ember app into the browser window.
    
    In 3.x, we changed it so that the Ember app is always built into `electron-app/ember-test`, so we don't need to pass this extra information around at runtime. So we're now simplifying and better organizing the test infrastructure:
    
    * Remove the code that handles passing the Ember app location through to the test main process
    * Put the `electron-protocol-serve` setup code into a blueprint-generated utility function. This way the production and test versions of the app use the same code, and it's easier to see the correspondence between the two different usages
    * Reorganize the test support code a bit for better flexibility -- rather than the test `index.js` just requiring a single file that runs all the test main process code, it imports some functions and calls them. This makes it a bit easier to read and understand, makes it easier to share code between the production and test main processes, and also allows more flexibility for users to customize, since the functionality that `ember-electron` supplies isn't all-or-nothing
    * await the Ember Inspector installation before opening the browser window, to make sure we don't have a race condition. This should fix the intermittent failures we've seen in the test that verifies that we install Ember Inspector.
    * Make end-to-end test more robust -- in this test we paste some code into the test `index.js` to verify some functionality, so rather than putting it at module scope, we put it in a function that we call so we don't have to worry about naming conflicts/duplicate imports between the blueprint-generated code and the test code we paste into the same file
    bendemboski committed May 21, 2020
    Configuration menu
    Copy the full SHA
    c80833b View commit details
    Browse the repository at this point in the history
  2. Fix electron command unit test

    When running not in CI, the electron command unit test was showing a building spinner, which pollutes the test output and can cause the process to not exit because of a leaked interval timer, so stub out the progress methods
    bendemboski committed May 21, 2020
    Configuration menu
    Copy the full SHA
    f5471d7 View commit details
    Browse the repository at this point in the history
  3. Remove electron-protocol-serve

    `electron-protocol-serve` seems to have taken us too far off the beaten path, so this changes `ember-electron` to set up projects to load from file: URLs instead of the custom protocol. This requires a couple of workarounds to make Ember apps work properly when loaded from file: URLs -- all explained in detail in the new FAQ page. This gets us sourcemaps back in Electron 7+, and also removes the need for a variety of minor workarounds for security/sandboxing issues caused by our use of a custom protocol.
    
    Fixes #442
    bendemboski committed May 21, 2020
    Configuration menu
    Copy the full SHA
    8ebdf8d View commit details
    Browse the repository at this point in the history
  4. Fix build

    Unfortunately, due to bugs in Electron 9, we can't use devtron (electron/electron#23676). We could at least get Ember Inspector to load (using the workaround for electron/electron#23656), but hopefully Electron will turn around a quick fix at least for that second issue so we don't have to add a temporary workaround to the blueprint-generated code...
    bendemboski committed May 21, 2020
    Configuration menu
    Copy the full SHA
    2604346 View commit details
    Browse the repository at this point in the history