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

Use XFC's transpiled code, not source #26

Open
pgross41 opened this issue Sep 16, 2020 · 1 comment
Open

Use XFC's transpiled code, not source #26

pgross41 opened this issue Sep 16, 2020 · 1 comment

Comments

@pgross41
Copy link
Contributor

pgross41 commented Sep 16, 2020

This (cerner-smart-embeddable-lib.js#L3):

import Provider from 'xfc/src/provider';

Should be this:

import Provider from 'xfc/lib/provider';

Or better yet:

import { Provider } from 'xfc';

That change will allow apps to import the ES6 module

import 'cerner-smart-embeddable-lib';

Instead of plucking out the pre-built version

import './vendor/cerner-smart-embeddable-lib-1.3.0';

PowerChart errors with the ES6 module because of this spread operator in XFC (possibly other reasons too but this is the first error). It works if cerner-smart-embeddable-lib includes the lib version though.

Using the ES6 module will also allow apps to disable XFC logging by defining process.env.NODE_ENV per the readme. Thus partially resolving these issues:

The info about process.env.NODE_ENV should also be documented on this project's readme. There is no way a user would know the logging is coming from a dependency nor how to disable it.

I say the issues are "partially resolved" because non-webpack users will still have no way to disable logging. XFC should probably provide a run-time config to disable logging so that users of the pre-build .min.js version of cerner-smart-embeddable-lib can turn it off and utilize f-twelve.

@pgross41
Copy link
Contributor Author

cc: @james-ingold

pgross41 added a commit to pgross41/cerner-smart-embeddable-lib that referenced this issue Sep 16, 2020
shriniketsarkar pushed a commit that referenced this issue Oct 3, 2020
#26
* Import module instead of src in both places
* Added installation and usage info to readme
Co-authored-by: Patrick Gross <[email protected]>
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

No branches or pull requests

1 participant