Comments (8)
hi, 1.26 reverts back to having CommonJS as the default format, so everything should work as before.
btw, I'm cutting a new version (v2) where ESM will be the default format, and CommonJS a deep import
from dynoexpr.
actually if you're using node >= 13.10.0, you can use v2.4.0 and keep the code as is:
const dynoexpr = require('@tuplo/dynoexpr');
more details here: https://github.com/tuplo/dynoexpr#install
from dynoexpr.
While this approach now works for command-line node, it doesn't work for jest. What are the advantages of making this breaking change?
from dynoexpr.
you can still use v1.26.0, it works as before.
Having ESM export as default is where the ecosystem is going, other library makers have made that jump (ex: sindresorhus).
from dynoexpr.
for v1, it stays the same.
for v2, while Jest doesn't support ESM natively, you'll need to import the CJS version explicitly
const dynoexpr = require('@tuplo/dynoexpr/cjs');
I've added a Jest/CommonJS e2e test here https://github.com/tuplo/dynoexpr/blob/main/e2e/main-cjs.test.js
from dynoexpr.
I would have to change every place I import dynoexpr
to use the deep import so jest works. I don't understand the value.
from dynoexpr.
I understand your frustration, but v1.x has no changes and will keep being supported until all kinks with ESM are fixed.
from dynoexpr.
@cranberyxl you can use a configuration on Jest to keep using require('@tuplo/dynoexpr')
with v2.x (while Jest doesn't support ESM)
{
"jest": {
"moduleNameMapper": {
"dynoexpr$": "<rootDir>node_modules/@tuplo/dynoexpr/cjs"
}
}
}
from dynoexpr.
Related Issues (20)
- FR: Support multiple update actions HOT 5
- wrap arrays in createSet when using ADD and DELETE update actions HOT 2
- Cannot find module 'dynoexpr' or its corresponding type declarations. HOT 2
- Type error on params being passed into `docClient.update` HOT 3
- Array of objects HOT 2
- UpdateAdd attributes don't match HOT 3
- Question: Support for multiple values for the same attribute HOT 4
- Remove dependency on AWS-SDK HOT 6
- `dynoexpr` should handle `null` value type HOT 5
- not contains not working HOT 2
- High Severity Security Issue In aws-sdk Dependency HOT 2
- logical operator "OR" doesn't work HOT 2
- dynoexpr doesn't support if_not_exists HOT 2
- can't use comparison operator "<>" with boolean value HOT 2
- A combination of UpdateRemove with Condition throws an error HOT 2
- dynoexpr doesn't support list_append HOT 6
- Feature Request: Support validation of sets
- Breaking Change Not Documented HOT 4
- Dynoexpr doesn't allow to escape dynamic keys in objects HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynoexpr.