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

Loader improvements #2453

Merged
merged 1 commit into from
Jun 5, 2019
Merged

Loader improvements #2453

merged 1 commit into from
Jun 5, 2019

Conversation

ry
Copy link
Member

@ry ry commented Jun 5, 2019

This patch makes it so that RecursiveLoad doesn't own the Isolate, so Worker::execute_mod_async does not take ownership anymore.

Previously Worker implemented Loader, but now ThreadSafeState does.

This is necessary preparation work for dynamic import (#1789) and import maps (#1921)

@ry ry requested a review from piscisaureus June 5, 2019 01:34
This patch makes it so that RecursiveLoad doesn't own the Isolate, so
Worker::execute_mod_async does not consume itself.

Previously Worker implemented Loader, but now ThreadSafeState does.

This is necessary preparation work for dynamic import (denoland#1789) and import
maps (denoland#1921)
@ry ry force-pushed the loader_improvements branch from 439d4d1 to 958f4e9 Compare June 5, 2019 05:02
@bartlomieju bartlomieju mentioned this pull request Jun 5, 2019
2 tasks
let referrer = referrer.to_string();

let f =
futures::future::result(ThreadSafeState::resolve(&specifier, &referrer));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok, but here's a tip: Result has an IntoFuture impl so you can do ThreadSafeState::resolve(&specifier, &referrer).into_future().and_then(...).

Copy link
Member

@piscisaureus piscisaureus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. LGTM

@ry ry merged commit e152dae into denoland:master Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants