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

Build instructions in README produce different bundles compared with prebid.org downloads #8458

Closed
dbirkbeck opened this issue May 24, 2022 · 11 comments
Assignees
Labels

Comments

@dbirkbeck
Copy link
Contributor

Type of issue

Request/question

Description

When building Prebid 5.x or lower I was able to directly compare the result with builds downloaded from prebid.org. (They matched) As of Prebid 6.x, builds no longer match. Can someone provide more detail on the build environment used for prebid.org so I can update by local build environment to match?

Steps to reproduce

This is not a bug but to reproduce, locally build any version of Prebid 6.x and then compare it to the same version downloaded from prebid.org.

Test page

Expected results

I should be able to directly compare locally built versions with versions downloaded from prebid.org.

Actual results

Platform details

node 14.18.1
npm 6.14.15

Other information

@spormeon
Copy link

spormeon commented Jun 5, 2022

chipping in on this one. we had an instance recently, where, apparently the "Global" can be set in the source build version but this is not available in the website download version, having this added to the website download version would be good, as i always build from the website, as i belive if its there its def working etc ( just my crazy logic)

@patmmccann
Copy link
Collaborator

This might be related to #7935

@dbirkbeck did it start with 6.17 or 6.0

@dbirkbeck
Copy link
Contributor Author

dbirkbeck commented Jun 5, 2022

@patmmccann, yes it appears to have started in 6.17.0. The 6.16.0 build matches as expected but 6.17.0 does not.

Is there anything that can be done to sync prebid.org and local builds up? (It makes troubleshooting issues very difficult when builds don't match up.)

@patmmccann
Copy link
Collaborator

it is possible the build date is included in the download page, investigating.

@patmmccann patmmccann added bug and removed question labels Jun 6, 2022
@patmmccann patmmccann moved this from Triage to In progress in Prebid.js Tactical Issues table Jun 6, 2022
@dbirkbeck
Copy link
Contributor Author

it is possible the build date is included in the download page, investigating.

To be clear, I'm not worried about the build date comment at the top of the build being different (such as the following).

/* prebid.js v5.20.4
Updated : 2022-04-19*/

It is understood that these comment dates will be different based on when the build was done. I'm more concerned that the prebid.org and locally built code itself is different.

@dgirardi
Copy link
Collaborator

dgirardi commented Jun 6, 2022

@dbirkbeck how are you comparing - are you removing the leading comment, then comparing checksums? Or any other steps to reproduce?

@dbirkbeck
Copy link
Contributor Author

dbirkbeck commented Jun 6, 2022

@dgirardi, yes I am removing the leading comment and then comparing using diff, checksums, and file sizes.

Again, I am only concerned about the code itself being different. Having prebid.org generated code not match local builds makes troubleshooting extremely difficult.

@dgirardi
Copy link
Collaborator

dgirardi commented Jun 6, 2022

@dbirkbeck you should be able to reproduce the exact bundle (minus the leading comment) by doing

gulp build && gulp bundle --modules=<module list>
instead of
gulp build --modules=<module_list>

the differences you see with the second are due to how the build can optimize away more code from unused modules (optimization was improved in 6.17). The website, for performance reasons, builds everything at once and generates bundles by concatenation (using an equivalent of gulp bundle).

You should also see a small decrease in size if you use build --modules, so ideally you'd keep that version. Do you have some more details on why troubleshooting is harder with it - is that something that could be improved in another way?

@dbirkbeck
Copy link
Contributor Author

Thank you @dgirardi. Great explanation. I am now able to reproduce the prebid.org build locally and they match. (At least for 6.17.0 anyway.)

I'l try my best to summarize my concern. While I do appreciate the small decrease in build size, usually it is best to have a single consistent version of code being produced whether downloading from prebid.org or building locally. As an example, say a particular browser works with one version and not the other. It could lead to a great deal of time being spent troubleshooting the wrong version.

I don't have any great suggestions for improvements other than perhaps updating the build documentation at https://github.com/prebid/Prebid.js to include your gulp build && gulp bundle --modules=<module list> instructions would help others.

@dgirardi
Copy link
Collaborator

dgirardi commented Jun 6, 2022

@dbirkbeck I agree with noting this in the build docs - I'll keep this issue open to track that.

I am less certain about making the "default" build match the website - probably because I am not familiar with your workflow and use case. My expectation is that people who go through the trouble of running their own build (either from source or npm) are doing it mostly to optimize code size.

@patmmccann do you have an opinion on this - if you follow the build instructions in the README, should you get something identical to what you get from prebid.org, or something marginally better?

As an aside, we could consider a larger goal of generating optimized bundles from the website as well.

@dgirardi dgirardi changed the title Prebid builds differ from prebid.org Build instructions in README produce different bundles comipared with prebid.org downloads Jun 6, 2022
@dgirardi dgirardi changed the title Build instructions in README produce different bundles comipared with prebid.org downloads Build instructions in README produce different bundles compared with prebid.org downloads Jun 6, 2022
@patmmccann
Copy link
Collaborator

My belief is that people will prefer the build size improvement.

Repository owner moved this from In progress to Done in Prebid.js Tactical Issues table Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

5 participants