Skip to content

Conversation

@rwjblue
Copy link
Member

@rwjblue rwjblue commented Oct 26, 2019

  • Make a vm.createContext per visit
  • Remove the ability to provide a custom sandbox class (we can always
    add this back if needed, but the complexity it adds seems quite high
    and very very few (if any) folks use it).
  • Ensure the scripts bytecode is shared between visit requests.
  • Various internal refactors to simplify things as we went.

Co-authored-by: @krisselden


TODO:

Follow-up TODO:


Closes #241
Closes #242

@rwjblue rwjblue requested a review from kratiahuja October 26, 2019 02:18
@rwjblue rwjblue force-pushed the build-vm-context-per-visit branch 2 times, most recently from f90d10a to 85f0392 Compare October 30, 2019 18:41
@rwjblue rwjblue requested a review from kratiahuja October 30, 2019 19:09
Robert Jackson and others added 7 commits October 30, 2019 16:12
Co-authored-by: Kris Selden <[email protected]>
Avoid reevaluating the app files and vendor files from scratch for each
visit request.

Co-authored-by: Kris Selden <[email protected]>
…nce`)

* Collapse `createEmberApp` into `buildApp` (since we are no longer
  separating the concepts of `Ember.Application` vs
  `Ember.ApplicationInstance`)
* Stash the `Ember.Application` instance (along with the
  `Ember.ApplicationInstance` instance) after creation, for destruction
  later
* Ensure destruction of both `Ember.Application` and
  `Ember.ApplicationInstance` occur when the `visit` has completed.
This helps ensure that if the dist files themselves are invalid, we fail
fast (e.g. before the first `fastboot.visit()` invocation).
@rwjblue rwjblue force-pushed the build-vm-context-per-visit branch from 3cc609a to 5a1b968 Compare October 30, 2019 20:13
@kratiahuja
Copy link
Contributor

@rwjblue Thanks for making these changes, these look good to me except the two questions above.

Robert Jackson added 2 commits October 30, 2019 19:23
…t requests.

This shows that mutating the prototype of an object used in multiple
requests, leaks that mutation.
@rwjblue rwjblue force-pushed the build-vm-context-per-visit branch from 5a1b968 to 0893cec Compare October 30, 2019 23:24
@rwjblue rwjblue changed the title Refactor to use a single vm context per visit request. Refactor to use a single sandboxed context per visit request. Oct 30, 2019
@rwjblue rwjblue merged commit cf0f451 into ember-fastboot:master Oct 30, 2019
@rwjblue rwjblue deleted the build-vm-context-per-visit branch October 30, 2019 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants