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

File upload - simplify a bit with gloo::file::FileList::from #3685

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

knzai
Copy link

@knzai knzai commented Jul 20, 2024

Description

gloo::file::FileList::from can do some of the conversion for us, removing the need for an auxiliary fn. This leads to trimming down the callbacks a bit. And hey, we have this FileDetails, why not just use it instead of passing the vars separately?

Checklist

  • [ x] I have reviewed my own code
  • I have added tests
    Example tests?

Copy link

github-actions bot commented Jul 20, 2024

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
async_clock 98.044 98.044 0 0.000%
boids 168.187 168.187 0 0.000%
communication_child_to_parent 90.549 90.549 0 0.000%
communication_grandchild_with_grandparent 102.778 102.778 0 0.000%
communication_grandparent_to_grandchild 98.207 98.207 0 0.000%
communication_parent_to_child 86.901 86.901 0 0.000%
contexts 102.367 102.367 0 0.000%
counter 83.544 83.544 0 0.000%
counter_functional 83.969 83.969 0 0.000%
dyn_create_destroy_apps 86.927 86.927 0 0.000%
file_upload 97.942 97.245 -0.697 -0.712%
function_memory_game 164.288 164.288 0 0.000%
function_router 338.087 338.087 0 0.000%
function_todomvc 158.255 158.255 0 0.000%
futures 226.149 226.149 0 0.000%
game_of_life 105.657 105.657 0 0.000%
immutable 186.278 186.278 0 0.000%
inner_html 77.900 77.900 0 0.000%
js_callback 105.875 105.875 0 0.000%
keyed_list 195.677 195.677 0 0.000%
mount_point 80.877 80.877 0 0.000%
nested_list 111.612 111.612 0 0.000%
node_refs 88.216 88.216 0 0.000%
password_strength 1712.037 1712.037 0 0.000%
portals 91.121 91.121 0 0.000%
router 308.771 308.771 0 0.000%
simple_ssr 138.063 138.063 0 0.000%
ssr_router 375.353 375.353 0 0.000%
suspense 112.439 112.439 0 0.000%
timer 86.486 86.486 0 0.000%
timer_functional 95.247 95.247 0 0.000%
todomvc 139.418 139.418 0 0.000%
two_apps 83.573 83.573 0 0.000%
web_worker_fib 132.149 132.149 0 0.000%
web_worker_prime 182.645 182.645 0 0.000%
webgl 80.607 80.607 0 0.000%

✅ None of the examples has changed their size significantly.

ranile
ranile previously approved these changes Jul 21, 2024
Comment on lines 42 to 43
self.files.push(file);
self.readers.remove(&name);
Copy link
Member

Choose a reason for hiding this comment

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

If you flip these two lines, you should be able to avoid the clone above. It doesn't really matter though

@knzai
Copy link
Author

knzai commented Jul 21, 2024 via email

Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! If you merge latest changes from master, the Rust CI should be green

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

Successfully merging this pull request may close these issues.

None yet

2 participants