Popper-core: Dist/popper.js

Created on 17 May 2017  ·  24Comments  ·  Source: popperjs/popper-core

Am I missing something, or is there no compiled popper.js or popper.min.js file in this repository, as a place for quick reference?

I'm following the v4-dev branch of Bootstrap via bower, and popper.js has been recently added to do the popovers instead of tether.js

I have a build process that takes numerous files for various libraries, and combines them into a single file. Previous this would have combined tether.js, bootstrap.js, and other js libraries into a single file.

However I can't find one single, compiled file that contains popper.js, so I can't just swap out tether.js for popper.js.

Infact, the only place I have found the right file is on cdnjs:

https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.9.4/umd/popper.js

Can you please create a 'Dist' folder and place the compiled library in a single file for ease of use?

# QUESTION ❔

Most helpful comment

I understand that, but the vast majority of libraries include the compiled code for quick and easy reference. Bootstrap does this itself.

I can do npm packages though, so I'll reference that instead.

Just a shame, as Boostrap is now referencing popper.js as a dependency in bower(so it's being downloaded automatically through bower), when in reality there is nothing of use in the repository in terms of compiled code that people can actually use or add to their build processes.

All 24 comments

Hi, I'm not hosting the compiled source code on the repository because the repository is the home of the source, not of the compiled code.

The official place where you can grab the compiled source is from npm, if you need an URL, the suggested one is:

https://unpkg.com/popper.js

Which is actually a mirror of npm.

I understand that, but the vast majority of libraries include the compiled code for quick and easy reference. Bootstrap does this itself.

I can do npm packages though, so I'll reference that instead.

Just a shame, as Boostrap is now referencing popper.js as a dependency in bower(so it's being downloaded automatically through bower), when in reality there is nothing of use in the repository in terms of compiled code that people can actually use or add to their build processes.

You can use the unpkg url with bower

If anyone makes his/her way here after searching for a solution (to find or compile popper within repo), it looks like you can build with lerna run build and find the library at packages/popper/dist/umd/popper.js

You can directly run npm run build to avoid to install Lerna globally also.

thanks guys, it took me a while to figure out that there were no compiled code for popper.js in the github download.
I checked the example files and saw the link to https://unpkg.com/popper.js. I downloaded the file from unpkg.com. But I had to do a quick google search to make sure I wasn't searching for the code in the wrong folder.

@FezVrasta Maybe you could be more explicit in the readme.md, that the files on github is only the source, i really thought the installation section was just about which cdn also host the distribution files.

So in a nutshell, it looks like a dist folder shall not tarnish this repo because:

  1. It's not pure to the definition of a source code repo, even though it cost nothing / hurts nothing
  2. Nevermind it's standard practice across a wide variety of major projects
  3. Nevermind people here are downvoting it 10 to 1 in the May 17 comment above

@whitneyland:

  1. it does cost, contributors will have to make sure to keep the dist/ files in sync, new contributors will have to remember to not edit the dist/ files but the src ones.
  2. I don't see dist folders in React, Angular, or Ember. It doesn't really seem a "standard practice"
  3. 11 people downvoted, on 5240 who starred the repository. It looks like a good proportion to me.

@FezVrasta, I think you should reconsider as popper.js is now a dependancy of bootstrap v4 which does offer a dist making it a huge pain for people who are stuck using bower from old alpha v4 setups. I understand that this anything but ideal however until bootstrap v5 we are stuck with old bower setups.

Alternatively bootstrap may bundle popper.js (https://github.com/twbs/bootstrap/issues/22783) but that sucks for people who are using webpack.

Good lord, at least document the CDN location prominently on the website.

I get it that it's a "source code repository".

Is it also a "source code website"?

There's a big button that says "Download V1". Most EVERYONE would expect such a button to lead to at least instructions on downloading the built product.

It's just odd how dogma gets in the way of pragmatism in cases like this. Some of the arguments given against /dist were:

1a) contributors would have to make sure /dist is always in sync - No, this is what build automation is for. If people are not using the proper build workflows we have worse problems to deal with.

1b) contributors will have to know to edit /src instead of /dist - This is just one of many ways a new person could make a mistake. Projects can have red flashing lights directing new people to a mandatory checklist, which solves this issue as well as the 100 other potential new contributor issues at the same time. It's also a pretty junior mistake - if contributors don't know the difference between /src and /dist it's likely there are bigger fish to fry with the problems that are going to crop up.

2) Using /dist is not a widespread standard practice for many major projects, because look at a few large projects that don't use it like... I think it wouldn't be hard to make a case that it's common enough such that most developers recognize what it is right away. However I dont think it's worth the time to research where the hairs should be split, so instead I will graciously concede this point, and don't believe doing so significantly weakens the argument overall.

3) 16 people downvoted this idea, but 5000 starred the repo, so the numbers look pretty good - Where to begin with the logic errors here? You've created a very nice piece of software here, it's benefiting many people, and it has widespread impact. This is why the stars exist. The stars have less than nothing to do with the fact that many people think this one small decision is the wrong way to go. Please, understand that you have my respect as an engineer and that this is a good project. Please also understand stars do not relate to small, individual, project decisions.

There are some additional minor benefits to maintaining /dist that haven't been discussed here yet, glad to describe them if we think they would add any weight to the decision.

So, nobody noticed that the latest releases include a dist folder.. Ooookay 😇

I noticed, thank you and +1

The amount of time I've wasted getting popper dist and now the map that I have to compile myself (because Chrome is trying to grab it) is unreal, but not at all unexpected for today's developers.

Make things pretty, not functional, is the new mantra these days.

Hey @tones31, what problems are you encountering? Didn't the dist targets instruction help you?

What's the problem with the source maps? I provide source maps of every file and you don't have to perform any additional step to make them work.

Actually, the dist targets instructions DON'T help, since they don't say where the dist directory is, and I haven't been able to find it. Can you please point it out, and then update the documentation?

Maybe it's just I haven't had my morning covfefe, and my eyes aren't quite working yet. ;)

As far as Bootstrap 4, they now provide a dist option with popper built-in, BTW.

The directory is always at the root of the project, if you install it through npm it will be /dist, if you install it with Bower it will still be /dist.

If you are looking for the /dist folder in the GitHub files list, you will not find it, because we don't host the dist files in our source code, you can checkout any release tag and find the /dist folder there anyway.

@FezVrasta I appreciate your library, but to be honest, I just want to use Bootstrap 4, which is what most people are coming here for. I think if you pointed people who are just looking for the /dist files towards the /tags section, and mentioned that all dist files are included in the Source Code .zip you won't have to answer questions by impatient people such as myself :)

@jtara Is it the one named bundle?

@tones31 why don't you use a package manager? That's the suggested way (even by Bootstrap).

If you copy Popper.js from the repository, you will not get the updates I release, and you will have to manually update all your dependencies.

@FezVrasta Sometimes you need to create a simple webpage and host your files statically without worrying about installing packages and package managers and so on.

You should still use a package manager, it just makes everything easier

$ npm install [email protected] popper.js jquery

# index.html
<script src="./node_modules/jquery/dist/jquery.js"></script>
<script src="./node_modules/popper.js/dist/umd/popper.js"></script>
<script src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>

# done

@tones31, yes, with latest Bootstrap 4, it is the one with bundle in the name.

If you just want a simple download, you can get it easily from unpkg.com. The symbol file is there too.

Off Topic, but I would strongly advise against placing node_modules in a web root as it will include all kinds of files including tests. Most packages are probably fine but I have found some that had php etc. code in them which would most likely then be executable on the web server resulting in a possible security risk.

Was this page helpful?
0 / 5 - 0 ratings