-
Notifications
You must be signed in to change notification settings - Fork 61
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
Create Fluent-northstar wrapper packlet #2983
Conversation
Chat bundle size is not changed.
|
Calling bundle size is not changed.
|
CallWithChat bundle size is not changed.
|
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.
This is a creative way to solve the fluent northstar problem!
There are 3 questions in my mind needs answers for this:
- The final chat/calling bundle(contoso app bundle, not our sdk package) would be surely bigger, how much bigger it will be?
- Is it possible to avoid the bundle size increase for calling app? Cause it is not fluent northstar related
- In contoso app (samples/chat as example), I guess they will have to download 2 dependencies of react? How do they choose which react version they wanna use? Is there global conflicts for these 2 versions?
I guess we can get some answers when we hook this up with our existing packages and send another PR to build it. That PR will build the calling app and show how much bigger it is, like this:
Depends on how well we can support treeshaking in the bundle, ideally this package will create a dist-esm folder that can be treeshaken just like any package.json.
Again depends on treeshaking support. If we have to go down the route of one bundled js file then we can't avoid it - technically it should be possible but we'll see how difficult it will be. Hopefully the increase will be small though as only the chat and it's dependencies would be added to a calling bundle (as calling already has to bundle the n* theme provider and uses components like Ref from n*)
Nope! Only one version of react will be used. Essentially what this packlet will hopefully do is re-bundle the necessary exports without the peer dependency restriction. It'll still require a peer dependency on react but we'll specificy this peer dep can be react 18. The n* components will now use react 18 and we need to bug bash any possible regressions with doing so (very quick POC we're not seeing any issues so hopefully we won't run into big blockers) To add to this, this PR is just adding the packlet, the bundling implementation will come in future PR. |
@@ -10,7 +10,8 @@ | |||
"@internal/calling-stateful-client": ["../../calling-stateful-client/src"], | |||
"@internal/chat-stateful-client": ["../../chat-stateful-client/src"], | |||
"@internal/react-components": ["../../react-components/src"], | |||
"@internal/react-composites": ["../../react-composites/src"] | |||
"@internal/react-composites": ["../../react-composites/src"], | |||
"@internal/northstar-wrapper": ["../../northstar-wrapper/src"] |
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.
heads up we might have to add this at a future time to the storybook and sample app tsconfigs&webpack configs -- but lets only do that when/if we need to
Thanks for adding details of this wrapper - so I kinda misunderstood the purpose of this wrapper, lemme try to update my understanding:
So I guess we are going to add webpack or some other bundling into this(for now this PR is only opening the new package)? If that is what we are doing then we might need to set React and some other packages as external dependencies, to avoid duplicate dependencies, like this: https://stackoverflow.com/questions/33154285/exclude-react-from-webpack-bundle |
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.
Curious on what the dist-esm will look like after we finish the bundling code implementation, please add me to reviewer list when it is ready
Would be nice to see a webpack analyzer dependency map or something similar in the end, if we solve the duplicated bundling problem, this would be a perfect workaround |
What
Add a new internal wrapper packlet, which will be the home of all northstar dependencies during the interim migration to support React 18
Why
#1900 (comment)
How Tested
Build and package
Process & policy checklist
Is this a breaking change?