Skip to content

Split core.js into smaller chunks#785

Closed
BraulioVM wants to merge 28 commits into
qunitjs:masterfrom
BraulioVM:split-core
Closed

Split core.js into smaller chunks#785
BraulioVM wants to merge 28 commits into
qunitjs:masterfrom
BraulioVM:split-core

Conversation

@BraulioVM

Copy link
Copy Markdown
Contributor

This PR tries to close #782.

I make the pull request now so that anyone can see how I'm approaching the task and can tell me whether I'm doing something wrong. As it is work in progress, it may not pass the tests

@BraulioVM

Copy link
Copy Markdown
Contributor Author

CI not working because of this: #782 (comment)

Comment thread src/core/utilities.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder where this function is actually getting used - maybe move it to stacktrace.js?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's just being used in assert.js, would it make sense to put it inside that file?

@BraulioVM

Copy link
Copy Markdown
Contributor Author

I'm not sure why the build has failed. I have tried to fix the error in the test-on-node task, but can't seem to find where it comes from

Comment thread src/core/stacktrace.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If its used only in assert.js, yes, it should go there.

Also: Remove the space before the opening paren.

@jzaefferer

Copy link
Copy Markdown
Member

Try grunt test-on-node --stack to get more details from grunt. Sadly the --stack option is still not enabled by default.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

Done, thank you for the tip!

Now the build is passing in my local repository while it is not in jquery's. I think this may be browserstack's fault

@jzaefferer

Copy link
Copy Markdown
Member

Yeah, more BrowserStack timeouts. Haven't been able to track down the cause of those, so for now we have to just ignore them. I'll review the diff...

Comment thread src/assert.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a specific rule, but as this is a support method, it should be placed in the end, or after the Assert declaration and prototype definition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it feels right at the end of the file.

I put it there because it was at the top of the core.js file, and thought it was something you guys preferred to do.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

I might have shaken things too much this time, specially with the control and loggingCallbacks directories.

Waiting to hear what you think of this.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

I have kept moving things out of core

The content of the new core/test.js file is suspicious to be refactored because it makes core depend on test, making it a circular dependency. I'll inspect this tomorrow.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

The failed build is browserstack's fault again.

What do you guys think of the current state of the PR?

@jzaefferer

Copy link
Copy Markdown
Member

I have very limited bandwidth for PR reviews this week. I hope @leobalter can provide you with some feedback for now.

Comment thread Gruntfile.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This went deep, and I don't believe it's better to make this split into many files.

There're some things I liked, like the errorString function going to the assert.js file.

Maybe a better approach, using smaller files:

  • src/core/module.js: it doesn't exist.
  • src/core/test.js: may go to src/test.js
  • src/core/control/* they can stay at core.js
  • src/core/loggingCallbacks/* => src/core/logging.js would be fine
  • can create a src/utilities.js containing:
    • src/core/utilities.js
    • src/core/extend.js
    • src/core/objectType.js
    • src/core/urlParams.js
    • src/core/defined.js
  • src/core/config.js is fine

Comment thread src/core.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing eof line

@leobalter

Copy link
Copy Markdown
Member

caught only code style issues, and I'm already running tests on a local updated branch and I'll also manually check browserstack.

@leobalter

Copy link
Copy Markdown
Member

I'm already running tests on a local updated branch and I'll also manually check browserstack.

Passing!

@BraulioVM

Copy link
Copy Markdown
Contributor Author

Ok, everything has been fixed! Is this ready for merge?

@BraulioVM BraulioVM changed the title Split core.js into smaller chunks [WIP] Split core.js into smaller chunks Apr 22, 2015
@BraulioVM

Copy link
Copy Markdown
Contributor Author

I have changed the title of the PR because it seems to be ready. Any other thing I should do?

@BraulioVM

Copy link
Copy Markdown
Contributor Author

Any thoughts?

@jzaefferer

Copy link
Copy Markdown
Member

By now this needs a rebase to be able to merge it. Haven't yet looked into the individual conflicts.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

Sorry I have been afk because I had to study for my exams. Still any interest?

@leobalter

Copy link
Copy Markdown
Member

Yes, sure. I'm actually you're back!

On Jun 5, 2015, at 1:49 PM, Braulio Valdivielso Martínez notifications@github.com wrote:

Sorry I have been afk because I had to study for my exams. Still any interest?


Reply to this email directly or view it on GitHub.

@jzaefferer

Copy link
Copy Markdown
Member

I think Leo meant "glad you're back". @BraulioVM do you need more input somewhere? Seems like for now we "just" need a rebase.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

I'm sorry it took me so long but I'm studying for my exams right now and couldn't look into this.

I hope it's done now. Tell me if anything else is needed, but I cannot assure you whether I will be able to get any important work done as I'm still studying.

@leobalter

Copy link
Copy Markdown
Member

Yes, I'm glad. My autocorrector is not because of multiple languages everyday.

On Jun 17, 2015, at 10:28 AM, Jörn Zaefferer notifications@github.com wrote:

I think Leo meant "glad you're back". @BraulioVM do you need more input somewhere? Seems like for now we "just" need a rebase.


Reply to this email directly or view it on GitHub.

@jzaefferer

Copy link
Copy Markdown
Member

We really need to land this as soon as possible. Going through my email notifications in chronological order this morning, I ended up merging #822 before looking at this, and that caused another merge conflict. Sorry about that.

@BraulioVM could you do the rebase magic once more? I think we can manage to hold off on any other commits to master for a little while, until this is done. Hopefully you can squeeze this in between your study.

@BraulioVM

Copy link
Copy Markdown
Contributor Author

Rebase magic done.

CI is failing, but I think it is not my fault. Could you look into it? It looks like there is a bug in browserstack/cli.js

@jzaefferer

Copy link
Copy Markdown
Member

@leobalter could you do another review of this?

@leobalter

Copy link
Copy Markdown
Member

LGTM, :shipit:

leobalter added a commit that referenced this pull request Jul 15, 2015
@leobalter leobalter closed this in 825691f Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Splitting core.js into smaller components?

4 participants