-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
chore: add Node Releases JSON to bundle #5443
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@HinataKah0 is attempting to deploy a commit to the OpenJS Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Can I get someone to approve the deployment (Not PR)? |
@HinataKah0 I just approved your deployment. Sorry for the delay! |
It is being tracked atm. You should be able to do |
FYI IMHO you should actually do the following:
This will tell git to ignore future changes to this file. |
If I understand correctly, this is only available in local machine. Edit: |
Incorrect. The command above applies to the repository. (Doesn't matter if local, others or upstream) as soon as they pull this commit it will affect them. |
Client Side: Screen.Recording.2023-06-20.at.8.43.20.PM.mov126kB (compressed) -> 441kB (uncompressed) Included in the bundle: Screen.Recording.2023-06-20.at.8.45.30.PM.mov127kB (compressed) -> 435kB (uncompressed) (I can't explain why this is lower uncompressed) I feel that it's far better to include the Node Releases data in the bundle for now... |
After fighting with Git for some time... I tried both approaches described above and some other combinations but nothing work 😅 I think we just don't want to upset TS, right? Edit: What do you all think? |
Not really needed.
Not sure what you're doing wrong. Also not sure what behaviour is happening for you. I also have no idea what exactly you're doing. It would be interesting if you could write the steps you're doing. |
Not sure what you're saying. The JSON file type is resolved implicitly by TypeScript itself, so no need to define types for the JSON. The Provider itself has a type, and if you pass the mapped data it should also be all good. If that is still not enough you can create a type for an individual entry of the array and pass it within the callback |
Oops, I just typed it out without re-reading again. 😅 So, I tried exactly these steps:
It works in my local (the JSON file is not tracked). I tried the step suggested by Mike as well but it also doesn't work. I've tried other combinations of steps as well but none is working. Not sure if it just happened to me or not. 😅 Then, I checked online, it seems that I believe our concern of having the JSON file with empty array |
What if after committing the file with the empty array you re-add the file to the gitignore? |
This comment was marked as outdated.
This comment was marked as outdated.
The step suggested by Mike will delete the actual file in remote, see here (talking about this outdated comment above)
I tried it as well... |
What about this: https://stackoverflow.com/a/26245961 |
88a03a1
to
324cfd8
Compare
@HinataKah0 did you follow Husky getting started steps correctly? The |
NVM, just saw it. |
I followed these steps: https://typicode.github.io/husky/getting-started.html#automatic-recommended |
FYI I've pushed some little changes to your branch to fix some things. (Like Husky) |
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.
LGTM! Good stuff, @HinataKah0!
BTW nvm the PR failures, that's something else that I'm patching on |
ccb387b
to
396c317
Compare
Thanks! FYI, my original intention of keeping different types ( I am okay with the new abstractions ( |
Result: #5443 (comment)
This PR will include Node releases data JSON in the bundle. Based on our experiment, we found that fetching the JSON file in Client Side harms UX badly in slow 3G network. Not to mention that the bundle size increment is tiny and it takes a very long time for it to grow and become harmful.
We added
node-releases-data.json
containing an empty array[]
as placeholder. This file will be overwritten during Build time and we don't want to commit unnecessary changes. However, once a file exist in the repository,.gitignore
won't work anymore. As a workaround, we will have a pre-commit hook to discard the changes.We use
husky
for pre-commit hooks (we followed these steps).Related to: #5438