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

Consider bumping the MAX_FILE_SIZE_TO_PARSE_MB #1237

Closed
iann0036 opened this issue Sep 11, 2020 · 7 comments
Closed

Consider bumping the MAX_FILE_SIZE_TO_PARSE_MB #1237

iann0036 opened this issue Sep 11, 2020 · 7 comments
Labels
state:stale Issues marked as stale. These can be re-opened should there be plans to fix them.

Comments

@iann0036
Copy link

Describe the problem and steps to reproduce it:

For consideration, the minified version of the AWS JS SDK with all services has recently just busted 4MB. It would be helpful if the limit was adjusted to 8 or even just 5.

https://github.com/mozilla/addons-linter/blob/master/src/const.js#L92

What happened?

I tried to upload an extension with the AWS JS SDK minified with all services.

What did you expect to happen?

The upload to pass validation.

Anything else we should know?

Relates to #181

@jvillalobos
Copy link

The minified version appears to be 2.5 Mb, so that would still work (but require sending the original sources separately).

Generally, I think our policy about this constant is that it should be bumped up when there are enough valid use cases that warrant larger JS files. Figuring out "enough" and "valid" should probably fall on @kewisch, though. As the comment in the source explains, these very large files are problematic in their own right, so they should be avoided as much as possible, especially for extensions which are supposed to be lightweight.

@iann0036
Copy link
Author

iann0036 commented Oct 1, 2020

Hi @jvillalobos,

The 2.5 Mb version only contains the "default services" of AWS, and excludes some important services for my use case. If you visit https://sdk.amazonaws.com/builder/js/ and instead select the "Select all services" option, you'll find the minified build to be 4.1 Mb.

@jvillalobos
Copy link

Do you need all of them, or are you choosing all out of convenience? This file needs to be loaded by Firefox on a regular basis and will impact general performance.

@iann0036
Copy link
Author

iann0036 commented Oct 1, 2020

I unfortunately need most of them.

I could split them out and load them individually, but that would be a very tedious process both for myself and addon reviewers. This is the README I currently bundle for addon reviewers:

# Notes for Add-on reviewer

The aws-sdk-2.xxx.0.min.js file can be generated at https://sdk.amazonaws.com/builder/js/ with the "Select all services" option, then removing the following services:

* RedshiftData
* Bracket
* IVS
* HoneyCode
* KinesisVideoSignalingChannels
* ConnectParticipant
* ComprehendMedical
* Translate
* Comprehend
* Rekognition
* MTurk
* LexRuntime
* CloudSearchDomain
* CloudSearch

Note the build time on the page can be a few minutes. Also included the base file (Development) in this archive.

Credentials are available on the whiteboard.

@NiharRanjanBisaria

This comment has been minimized.

@iann0036
Copy link
Author

iann0036 commented Mar 6, 2021

Future travellers; I am now using this dodgy Python script to split my AWS SDK (v2):

import os
import json
import requests
import pprint

stream = os.popen('npm show aws-sdk version')
version = stream.read().replace('\n','')
metadata = json.loads(requests.get('https://sdk.amazonaws.com/builder/js/cache/' + version + '/metadata.json').text)

output = ''
partno = 1
line = 'x'

with open('aws-sdk-' + version + '.js', 'r') as f:
    while line != '':
        i = 0
        while i < 100000 and line != '':
            line = f.readline()
            output += line
            i += 1
        while line != "\n" and line != '':
            line = f.readline()
            output += line
        with open('aws-sdk-' + version + '-part' + str(partno) + '.js', 'w') as f2:
            f2.write(output)
            output = ''
        partno += 1

@stale
Copy link

stale bot commented Sep 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.

@stale stale bot added the state:stale Issues marked as stale. These can be re-opened should there be plans to fix them. label Sep 3, 2021
@stale stale bot closed this as completed Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:stale Issues marked as stale. These can be re-opened should there be plans to fix them.
Projects
None yet
Development

No branches or pull requests

4 participants