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

top level await example updated with await keyword #29

Closed
wants to merge 1 commit into from

Conversation

xkeshav
Copy link

@xkeshav xkeshav commented Mar 1, 2024

in top level example file; update syntax with top level await

Copy link

github-actions bot commented Mar 1, 2024

It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@xkeshav
Copy link
Author

xkeshav commented Mar 12, 2024

any update here ?

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Apr 11, 2024
@bsmth bsmth linked an issue Jul 9, 2024 that may be closed by this pull request
@bsmth
Copy link
Member

bsmth commented Jul 9, 2024

Hi @xkeshav sorry I missed this one, I'm going through repositories to see if there's anything we overlooked. @Josh-Cena are you interested in having a look?

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Hello, unfortunately this change is anti-performance and unnecessary. We are using import on demand on purpose, and even if we don't, we will be using static imports instead of await import(...) at the top level, which you should virtually never do. If you check out the accompanying content text:

Then we'll create a module called getColors.js which uses a fetch request to load the colors.json file and return the data as an object.

The top level await is actually in the getColors.js file.

@github-actions github-actions bot removed the idle Issues and pull requests with no activity for three months. label Jul 10, 2024
@bsmth
Copy link
Member

bsmth commented Jul 10, 2024

Thanks a lot for chiming in, Josh. @xkeshav I hope that clarifies things for you. I'm going to close this PR now but if you have some more questions of if you think there's a mistake, please let us know here. Thank you :)

@bsmth bsmth closed this Jul 10, 2024
@xkeshav
Copy link
Author

xkeshav commented Jul 17, 2024

Got it. Thank you for the detailed explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants