-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor webpack configuration to improve library exports #1565
Refactor webpack configuration to improve library exports #1565
Conversation
@bcb37 Here 'output.library' is removed from the webpack config to get direct access to the modules. Should we keep it this way for easier module access, or do we keep the library name for namespacing? |
@KD1712 can you check the PR? There are some extra change. |
939afda
to
22a833e
Compare
…t direct access to other class and types export
22a833e
to
c4bd47e
Compare
clientlibs/js/webpack.config.ts
Outdated
@@ -34,8 +34,10 @@ const browser = { | |||
output: { | |||
filename: 'index.js', | |||
path: path.resolve(__dirname, 'dist/browser'), | |||
libraryExport: 'default', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are four variations where the same change needs to be done. Can you refactor the code and extract the common code?
@zackcl can you verify this is the change that was needed in demo app for vanilla js when you get back? |
@danoswaltCL I will check this now. |
I tried the client library on this branch, and I was able to create the However, while the When using the You can see the code I wrote for testing the client library here: https://jsfiddle.net/my93L5bg/. |
Yeah, I do get the same error. For |
@ppratikcr7 Thanks, so should we expect users to add this code when using "browser-lite"? I'm not sure if this is worth including in our documentation in case they use "browser-lite". If it's difficult to support "browser-lite", maybe we can just document that the lite version is not supported for JavaScript apps at the moment, and fix this later.
|
I will review the updated fiddle soon. |
@ppratikcr7 Your fiddle worked fine with the custom HTTP client. By the way, I had to change the version in |
@ppratikcr7 can you take over this PR and look at @zackcl 's comment, then we can get this in for 6.0 |
…lient-without-webpack-150
@zackcl Can you reapprove this and merge? |
Changed the webpack configuration to specify
library
as 'UpgradeClient' andlibraryExport
as 'default' to improve library exports. This ensures that users can directly access theUpgradeClient
class without needing to access it through additional objects. Also updated theglobalObject
to 'this' for better compatibility across environments.