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

Support Prototype Extensions #170

Open
hjdivad opened this issue Oct 17, 2017 · 5 comments
Open

Support Prototype Extensions #170

hjdivad opened this issue Oct 17, 2017 · 5 comments

Comments

@hjdivad
Copy link

hjdivad commented Oct 17, 2017

fastboot currently builds the application instance outside of the vm from within visitRoute

visitRoute currently utilizies the sandbox indirectly, via this.app which is created from an app factory returned from the sandbox.

If, instead, visitRoute delegated its work to a function run within the sandbox context, prototype extensions would work (or at least an impediment to their working would be removed).

@hjdivad
Copy link
Author

hjdivad commented Oct 17, 2017

I'm not familiar enough with the internals to be sure, but I imagine the rough todo is something like

  1. add a _visitRoute function to the sandbox context. This function would roughly do the work of buildAppInstance and visitRoute today (ie build the application instance and visit the route)

  2. change visitRoute to invoke _visitRoute on the sandbox.

@rwjblue
Copy link
Member

rwjblue commented Oct 17, 2017

Yes, that path forward seems correct to me.

@kratiahuja - Does that look right to you also?

@kratiahuja
Copy link
Contributor

Yes, we would also need to make sure the FastBoot result is outside the sandbox so that we can serialize and send the template.

But otherwise at high level it looks correct to me. I'll try finding the branch where I started some of this work last year.

@kratiahuja
Copy link
Contributor

kratiahuja commented Jan 22, 2019

Ok, so I did a spike of the above proposed option. However, prototype extensions still don't work in one usecase: When I define something outside of the sandbox (example sandboxGlobals) and access it inside the sandbox, it still does not work. Therefore it will still not work when a communication happens through najax. I believe this is how node releams work.

I can put out a PR otherwise but the above usecase will still not work.

@rwjblue
Copy link
Member

rwjblue commented Oct 26, 2019

@kratiahuja - I'm curious if you still have that WIP spike laying around locally. I'd be happy to dust it off and see about pushing it forward...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants