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

basis: Add tests, improve options handling, clean up demo #596

Merged
merged 2 commits into from
Dec 31, 2019

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Dec 31, 2019

A pass on the experimental BasisLoader

@coveralls
Copy link

coveralls commented Dec 31, 2019

Coverage Status

Coverage increased (+0.4%) to 54.173% when pulling 294e0fc on ib/basis-tests into 94b076f on master.

// Load from local files, not from CDN scripts in Node.js
// TODO - needs to locate the modules directory when installed!
if (!isBrowser) {
return `modules/${moduleName}/dist/libs/${library}`;

Choose a reason for hiding this comment

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

Since this is inside util module which will be shared by other modules, better to have stable way to resolve the module directory. Add an issue to track this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes good point, the dynamic module loading was a bit rushed in order to get ready for v2.0.

I will put together a separate, smaller PR with test cases for the library-util functions and we can iterate on design etc there.

if (options.CDN) {
assert(options.CDN.startsWith('http'));
return `${options.CDN}/${moduleName}@${VERSION}/dist/libs/${library}`;
}

// Note - Worker loading requires paths relative to worker script "location"?
// TODO - loading inside workers requires paths relative to worker script location...
if (isWorker) {
return `../src/libs/${library}`;

Choose a reason for hiding this comment

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

same here. To me, it is kind of fragile to resolve a path like this way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -11,6 +11,9 @@ import path from 'path';
// This indirect function is provided because webpack will try to bundle `module.require`.
// this file is not visible to webpack (it is excluded in the package.json "browser" field).
export function requireFromFile(filename) {
if (filename.startsWith('http')) {

Choose a reason for hiding this comment

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

Add a test case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ibgreen ibgreen merged commit b8552be into master Dec 31, 2019
@ibgreen ibgreen deleted the ib/basis-tests branch December 31, 2019 17:58
@ibgreen ibgreen mentioned this pull request Dec 31, 2019
11 tasks
xintongxia pushed a commit that referenced this pull request Jan 11, 2020
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