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

Convert to ESM, keep backward compatibility #296

Merged
merged 4 commits into from
Nov 29, 2024
Merged

Convert to ESM, keep backward compatibility #296

merged 4 commits into from
Nov 29, 2024

Conversation

davidyuk
Copy link
Member

@davidyuk davidyuk commented Nov 12, 2024

depends on #295

This PR is supported by the Æternity Foundation

We can drop cjs version in the next major version of calldata 🤔

Motivation:

@dincho
Copy link
Member

dincho commented Nov 28, 2024

➜  aepp-calldata-js git:(esm) make browser-tests
mkdir -p build/js
npm run browser-test-bundle

> @aeternity/[email protected] browser-test-bundle
> browserify tests/[A-Z]*.js tests/**/*.js > build/js/tests.js

Error: Parsing file /Users/dincho/projects/aeternity/aepp-calldata-js/tests/AciContractCallEncoder.js: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
    at Deps.parseDeps (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/module-deps/index.js:519:15)
    at getDeps (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/module-deps/index.js:447:44)
    at /Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/module-deps/index.js:430:38
    at ConcatStream.<anonymous> (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/concat-stream/index.js:37:43)
    at ConcatStream.emit (node:events:531:35)
    at finishMaybe (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/readable-stream/lib/_stream_writable.js:630:14)
    at endWritable (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/readable-stream/lib/_stream_writable.js:638:3)
    at Writable.end (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/readable-stream/lib/_stream_writable.js:594:22)
    at DuplexWrapper.onend (/Users/dincho/projects/aeternity/aepp-calldata-js/node_modules/readable-stream/lib/_stream_readable.js:577:10)
    at Object.onceWrapper (node:events:633:28)
make: *** [build/js/tests.js] Error 1

@dincho dincho merged commit baecd3e into master Nov 29, 2024
2 checks passed
@dincho dincho deleted the esm branch November 29, 2024 09:17
@dincho dincho added the feature Introduces new feature label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Introduces new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider providing a build using es6 imports/exports
2 participants