Change import package#2373
Conversation
|
Or at least it can be as follows: The following also works: I feel the code is cleaner with this method instead of using the code below: |
|
@jasoniangreen what happened?! |
I just wanted to pull master into your branch so I can see if it passes and do a proper review in the up to date context. |
|
Thanks. |
|
Hi @jarqvi, I don't really understand why should make this change? |
|
Hi @jasoniangreen, |
Ah ok, but it would be a potentially breaking change, correct? Depending on how people are currently importing it? |
Well, we can make these changes by keeping the previous method and be backward compatible |
@jasoniangreen Done. |
What issue does this pull request resolve?
In fact, some codes that were not needed much have been removed.
What changes did you make?
The recent removal of the line
const {default: Ajv} = require('ajv')was made possible by eliminating the export statementmodule.exports.default = AjvClass. As a result, we no longer require the named import of the Ajv module.And since we mentioned the following code sample in the documentation, I don't think there is a problem:
const Ajv = require("ajv")Is there anything that requires more attention while reviewing?
require packages in CJS