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

Dynamic import #2516

Merged
merged 1 commit into from
Aug 8, 2019
Merged

Conversation

piscisaureus
Copy link
Member

My attempt at fixing #2510.
The scope went a little overboard.
cc @ry

@piscisaureus
Copy link
Member Author

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Does this compile for you? I'm getting type errors.

I kinda see the point of having this register() function to pass the &mut Isolate into the module code, but I don't understand what is being streamed.

core/isolate.rs Outdated Show resolved Hide resolved
core/isolate.rs Show resolved Hide resolved
core/isolate.rs Show resolved Hide resolved
@piscisaureus piscisaureus force-pushed the loader_refactor branch 2 times, most recently from 43fd625 to 01b98de Compare June 15, 2019 17:17
@@ -140,6 +161,24 @@ impl<L: Loader> RecursiveLoad<L> {

Ok(module_name)
}

pub fn get_future(
Copy link
Member Author

Choose a reason for hiding this comment

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

Eventually this should go. I added it to make porting over the tests easier.

@ry
Copy link
Member

ry commented Jun 17, 2019

ref #1789

@piscisaureus piscisaureus force-pushed the loader_refactor branch 2 times, most recently from e5bb620 to 7b85cb9 Compare July 12, 2019 08:06
cli/state.rs Outdated Show resolved Hide resolved
@piscisaureus piscisaureus force-pushed the loader_refactor branch 4 times, most recently from 8fd5c92 to 3449974 Compare July 12, 2019 14:13
@ry ry changed the title Loader refactor Dynamic import Jul 12, 2019
@ry ry mentioned this pull request Jul 14, 2019
@ry
Copy link
Member

ry commented Jul 23, 2019

Update: This is close to landing and still being worked on.

core/isolate.rs Outdated Show resolved Hide resolved
@ry ry force-pushed the loader_refactor branch from 39d6eb6 to 59fc1ec Compare August 7, 2019 19:51
core/modules.rs Outdated Show resolved Hide resolved
core/isolate.rs Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Some remarks from me. I need a bit more time to grok modules::State though...

core/dyn_imports.rs Outdated Show resolved Hide resolved
core/isolate.rs Show resolved Hide resolved
core/modules.rs Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

/core/modules.rs became very hard to understand again, but we can surely update it down the road. It's awesome to finally have dynamic imports!

core/modules.rs Show resolved Hide resolved
core/modules.rs Show resolved Hide resolved
@ry
Copy link
Member

ry commented Aug 8, 2019

On appveyor the unit tests are failing. No idea why.

Summary for <no permissions>
undefined
Summary for --allow-read
test result: OK. 34 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (58.00ms)
Summary for --allow-net
test result: OK. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (5514.00ms)
Summary for --allow-read --allow-write
test result: OK. 47 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (80.00ms)
Summary for --allow-write
test result: OK. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (20.00ms)
Summary for --allow-env
test result: OK. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (10.00ms)
Summary for --allow-run
test result: OK. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (254.00ms)
Summary for --allow-write --allow-run
test result: OK. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (36.00ms)
Summary for --allow-read --allow-write --allow-run
test result: OK. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (72.00ms)
Summary for --allow-hrtime
test result: OK. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (-0.16ms)
Unit tests failed
FAIL

@piscisaureus
Copy link
Member Author

@ry
Copy link
Member

ry commented Aug 8, 2019

It's disabled https://github.com/denoland/deno/pull/2516/files#diff-06291984cb0c2f3e0fad6822ab277aec and not part of the unit tests.

I think we can land without error_014_catch_dynamic_import_error.js working yet.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@piscisaureus piscisaureus merged commit 6fbf2e9 into denoland:master Aug 8, 2019
@piscisaureus piscisaureus mentioned this pull request Aug 9, 2019
@piscisaureus piscisaureus deleted the loader_refactor branch August 9, 2019 01:49
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.

3 participants