This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Fix register() calls inside lib/index.js - #11
Merged
Conversation
Contributor
|
Hi there, thanks for your Pull Request! A Kurento member needs to verify that this patch is reasonable to test. In case it is, they should write a comment with the phrase |
… the target modules directly, but not modules names
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the current behavior you want to change?
When this package is installed via npm and used via Webpack (and maybe other bundlers), the following error occurs at build time.
I think this is because
requireinsideregisterwhich is dynamically called cannot be statically resolved by the bundler.What is the new behavior provided by this change?
With this PR's change, the error above is resolved.
And this change should not affect anything as the new code is virtually same to the current one, because
registercalled with a module name string withoutrequirelike the current code ends up callingregisterwithrequireinternally(https://github.com/Kurento/kurento-client-js/blob/master/lib/register.js#L68).How has this been tested?
I executed node test (
npm test) and browser test (./node/bin/grunt-> open the file via browser).In addition, I tested with Webpack project.
Types of changes
Checklist
I have written new tests for the changes, as applicable, and have successfully run them locallyI have confirmed the results of the local tests are the same to the previous code.