-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(fedback): Convert CDN bundles to use async feedback for lower bundle sizes #11791
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
69657ad
feat(fedback): Convert CDN bundles to use async feedback by default
ryan953 f471401
export feedbackAsyncIntegration in bundles
ryan953 318e480
export feedbackAsyncIntegration in all the bundles, as well as feedba…
ryan953 c7f2e4a
Merge branch 'develop' into ryan953/feedback-async-default
ryan953 d8994b2
linty
ryan953 b4188c1
fix line breaks
ryan953 f32acf4
linting
ryan953 1e27ac4
linting
ryan953 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@mydea What do you think about this alias?
The idea is that the docs will use
feedbackAsyncIntegration
for our npm setup instructions. So that's what people will copy paste and see all over the place.But for the CDN, most people probably won't interact with the integration name right?
I wanted to have a stable name so that we can flip from async to sync in the future if we wanted to and have it be transparent.
The CDN could alternatively ship
feedbackAsyncIntegration
to start, and then in the future ship bothfeedbackAsyncIntegration
andfeedbackIntegration
.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.
Actually, i'm thinking now that things like
getIntegrationByName
would still need to have'feedbackAsyncIntegration'
passed in because that's what the instance will be called. so the alias here isn't adding confusion to that case.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.
So there are two aspects to this:
getIntegrationByName
, but this is e.g.Feedback
, not the function name. Technically both the async and sync integration could have the same name, meaning any check forgetIntegrationByName('Feedback')
would return either one of these if installed (benefit of this is that it would become impossible to install both).Usage would be:
I am not so sure, it feels a bit weird to expose this to users like this 🤔 When using the CDN, is there ever a reason to not use the async variant? E.g. the only reason to do that in NPM is to avoid loading stuff from the CDN, which you are already doing anyhow in the CDN scenario 😅
So I think I would tend to just expose this as
feedbackIntegration()
. But this of course has two potential issues:I think part of the issue is that overall the naming of
feedbackAsyncIntegration
is not very user-friendly and clear (e.g. what does async mean in this context, ...). Mind you, I don't have any better ideas either 😅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.
100%... I had some feeling about some of these points but the getIntegrationName i was less sure about. You laid it out well, let see what levers we can pull to improve it:
getIntegrationName
This should be
Feedback
in both cases, becausebuildFeedbackIntegration
returns the same object, with different dependencies injected. So this sounds like the ideal ✅CDN default impl and function name
For the CDN bundle, we'll go with the slim bundle size, and async loading strategy. So this PR will deliver that.
What's the function name though?
Some ideas:
I think we should write the docs and that could help a lot
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.
What about this:
We always (CDN & NPM) have a
feedbackIntegration
, which uses some undefined loading strategy. Basically we'll use what we think works better, which on CDN is async and on NPM is sync.Then in addition we also have
feedbackAsyncIntegration
andfeedbackSyncIntegration
. On CDN only the former exists, on NPM both exist.Does that make sense?
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.
yes! i like this. It's good for docs-writing, because we can be consistent everywhere, and we'll just add the section for
loading strategies
to disambiguate. In that section can explain how it's Async for all the web-facing stuff, and we can make the electron package be Sync to both prove the point, but that's what I'd expect there anyway.I'll update this PR in a sec