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

Js package optimizaitons #1429

Merged
merged 3 commits into from
May 21, 2020
Merged

Js package optimizaitons #1429

merged 3 commits into from
May 21, 2020

Conversation

mstoykov
Copy link
Contributor

closes #1426

@mstoykov mstoykov added the tests label Apr 30, 2020
@mstoykov mstoykov requested review from imiric and na-- April 30, 2020 14:01
Comment on lines +181 to +182
var options = { setupTimeout: "1s", myOption: "test" };
exports.options = options;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I once knew why this is required ... but not anymore I will need to go figure it out again :(
It has something to do with the way we bind exports, but I decided to figure it out later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay so if you just do:
export.options = {} you don't have any local variable options, but you should be able to just use exports.options but there was a bug #1430 .

I can rebase only the fix on top of new-schedulers/master ? if we aren't going to merge this soon

@@ -466,8 +468,8 @@ func TestRunnerIntegrationImports(t *testing.T) {
name, data := name, data
t.Run(name, func(t *testing.T) {
r1, err := getSimpleRunner(data.filename, fmt.Sprintf(`
import hi from "%s";
export default function() {
var hi = require("%s").default;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to look into this ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay so ... basically setting default to something only works if babel helps us otherwise we should just say exports = "hi!" if we wont' be using babel.
much better explanation here. I don't think we need to do anything until we start supporting import/export ouself or through goja :D

Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

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

So this should save at least a minute+ on test in CircleCI? 👍

@mstoykov
Copy link
Contributor Author

my local testing was from 300s->160s and from 360s->176s (depending on the machine). Both with -race but without -cover

this should again lower the amount of time test take for close to zero
additional scripting.
@mstoykov mstoykov force-pushed the jsPackageOptimizaitons branch from d35c151 to 3d55b1d Compare May 1, 2020 10:27
na-- added a commit that referenced this pull request May 18, 2020
@na-- na-- merged commit 923f886 into new-schedulers May 21, 2020
@na-- na-- deleted the jsPackageOptimizaitons branch May 21, 2020 07:16
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.

3 participants