-
Notifications
You must be signed in to change notification settings - Fork 193
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
Conversation
// 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}`; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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}`; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8549c2c
to
294e0fc
Compare
…)" This reverts commit b2fa7bd.
A pass on the experimental
BasisLoader