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

Implement ECMAScript native modules, remove circular references #1936

Closed
haraldrudell opened this issue Feb 16, 2018 · 2 comments
Closed

Implement ECMAScript native modules, remove circular references #1936

haraldrudell opened this issue Feb 16, 2018 · 2 comments
Labels
duplicate This issue is a duplicate.

Comments

@haraldrudell
Copy link

haraldrudell commented Feb 16, 2018

If aws-sdk is bundled using @rollup, this fails at runtime with an undefined variable type error

action: remove circular references
This is likely caused by the habit of using ciruclar references which has traditionally been a bad practice with @nodejs

action: Implementing ECMAScript native modules for tree shaking
Implementing ECMAScript native modules, ie. import and export statements in the source code, would allow tree shaking which is a benefit for a huge library like aws-sdk

action: transpilation
This would require transpilation for Node.js older than stable Nodejs v8.5+
-- or two separate branches

symptom

code: 'CIRCULAR_DEPENDENCY',
importer: '../../node_modules/aws-sdk/lib/util.js',
'Circular dependency: ../../node_modules/aws-sdk/lib/util.js -> ../../node_modules/aws-sdk/lib/core.js ->
../../node_modules/aws-sdk/lib/util.js'

get-around
Define aws-sdk as a RollupJS external reference. It works when node require loads it.

I am using aws-sdk with es2049package
https://github.com/haraldrudell/ECMAScript2049/tree/master/workspace/packages/es2049package

@jeskew jeskew added the duplicate This issue is a duplicate. label Feb 17, 2018
@jeskew
Copy link
Contributor

jeskew commented Feb 17, 2018

Closing as a duplicate of #1769 & #1766. There's a fair amount of discussion on those issues, so I'd like to keep the conversation centralized there.

@jeskew jeskew closed this as completed Feb 17, 2018
@lock
Copy link

lock bot commented Sep 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

2 participants