Skip to content

Add CommonJS compatibility#25

Merged
wouterlucas merged 1 commit into
rdkcentral:masterfrom
LibertyGlobal:astolcenburg-commonjs
Oct 22, 2021
Merged

Add CommonJS compatibility#25
wouterlucas merged 1 commit into
rdkcentral:masterfrom
LibertyGlobal:astolcenburg-commonjs

Conversation

@astolcenburg
Copy link
Copy Markdown
Contributor

With this change, the module can be directly included
by node.js applications that use the CommonJS module system.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 22, 2021

CLA assistant check
All committers have signed the CLA.

@dersanli
Copy link
Copy Markdown

With this change, the module can be directly included
by node.js applications that use the CommonJS module system.

Hi @astolcenburg, currently I can't include ThunderJS like:
import ThunderJS from 'ThunderJS';
Does your PR solve this issue?

@astolcenburg
Copy link
Copy Markdown
Contributor Author

With this change, the module can be directly included
by node.js applications that use the CommonJS module system.

Hi @astolcenburg, currently I can't include ThunderJS like:
import ThunderJS from 'ThunderJS';
Does your PR solve this issue?

Hi @dersanli ,

yes, it will work thanks to the interoperability of ECMAScript modules with CommonJS: https://nodejs.org/api/esm.html#esm_interoperability_with_commonjs . But you need to use node.js >= 14 or node.js 12 with the --experimental-modules flag enabled.

@pradeeptakdas
Copy link
Copy Markdown
Contributor

Hi @michielvandergeest
Could you review this PR?

@dersanli
Copy link
Copy Markdown

Hi @michielvandergeest
Could you review this PR?

+1 pls

wouterlucas
wouterlucas previously approved these changes Oct 19, 2021
@wouterlucas
Copy link
Copy Markdown
Contributor

Validated with Lightning app, still works with the NodeJS related changes. Will push this through.

@wouterlucas
Copy link
Copy Markdown
Contributor

Please rebase so we can merge.

With this change, the module can be directly included
by node.js applications that use the CommonJS module system.
Copy link
Copy Markdown
Contributor

@wouterlucas wouterlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wouterlucas wouterlucas merged commit 70cbd70 into rdkcentral:master Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants