-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Publish to npm? #9
Comments
👍 |
In the mean time there is a workaround for people who want to use fetch with browserify:- |
I needed to add "name", "version", and "main" fields to package.json in order to use fetch with browserify. The changes are available here: https://github.com/ahutchings/fetch/blob/8a3829b6aed03f52e0589b538bc814d1b88f126c/package.json |
there's already https://www.npmjs.org/package/fetch, so you would have to rename it something else. maybe |
or fetch-polyfill? |
w3c-fetch? like w3c-blob or w3c-xmlhttprequest |
it's a |
cc @andris9, author of https://www.npmjs.org/package/fetch |
I'm willing to give up the npm name |
Nice! Who wants to be an owner on the npm package? This is how @andris9 would add you:
|
Since Also, switching from make to use the npm scripts (via the scripts in the package.json) would be nice. |
👍 for npm scripts. =) |
note, it should also have a module.exports conditional check in the main module itself.
should be exported regardless of if the shim is applied.. this way it can be used as a straight module in the rest of the code. |
Can I use npm? It doesn't work |
👍 - Too bad "fetch" is already taken. I really think npm packages should have been namespaced somehow. Maybe using the organization that created the package for example "github/fetch" and "andris9/fetch". Oh well, hindsight and whatever. |
@Blesh the name is taken, but the author offered to give it up. See above comments. To your point about namespaces:
|
@zeke oh nice! |
Hi all, I've made a little wrapper that allows fetch to be used in Node & Browserify called |
Still plans to do this? |
@necolas Have you tried |
Please can you npm-ignore the examples and test directories when this is published to npm. |
@necolas That's a bad idea. They should be |
@ericelliott I don't know what you think I wrote. |
What's the status on publishing this? :) |
I think someone else should just fork this and maintain whatever npm/browserify differences and publish to npm. I'll link it up from our README. |
If you remove |
Does node.js support XMLHttpRequest, though?
|
Well, you've said you're only interested in providing a client-side polyfill. You can already install this module via npm, just not via a package name and not using a version range. |
This question isn't really relevant to the usefulness of fetch in npm. There are a very large number of browser-only packages in the npm repository, and that's fine. npm is the repo for all things JavaScript. It's 5 times the size (and usefulness) of the bower registry. Lots of people use it mostly for client-side work with Browserify. |
👍
Agreed. |
Exactly why all this would be better done in a separate library that targets node.js directly rather than building on top of XHR. |
I think I'm just going to close this issue out. This repo is going to remain a browser polyfill assuming a browser environment. Definitely checkout https://github.com/matthew-andrews/isomorphic-fetch and maybe they'll be a node-fetch build on top of node's http lib. I'd be happy to link those up in the readme. Thanks. |
I still think this exact repo should be published to npm. npm is a great way to install polyfills. |
@domenic 👍 |
We'll definitely need an alt name on npm since fetch is taken. Hopefully something makes it clear that |
Also pro if someone could setup travis' npm releasing http://docs.travis-ci.com/user/deployment/npm/ so I don't have to be bothered forgetting the extra step. |
@josh, I've made a tool npm-prepublish that allows you to use GitHub releases & npm publish via Travis together seamlessly. the way it works is you first remove the Basically, you don't have to do the irritating/easy to forget Here's a worked example:- |
@matthew-andrews Travis also has a feature to push a new NPM release whenever there's a new git tag automatically. I should be able to submit a pull request for that later today. |
@hawkrives I use that. The problem is if you use the default Travis/npm approach you can't use GitHub releases otherwise the version number in My module eliminates this unnecessary step and requirement to release via the command line. |
Ah. |
the |
@hawkrives I owe you an apology. It turns out they were happy with the edit-package.json-and-bower.json-update-the-version-number-git-tag-git-push---tags workflow after all and that the changes you described were exactly what they wanted. I'm sorry for discouraging you from making a pull request that did that. |
@matthew-andrews No worries. Your take, and the ensuing thread, cleared up some good ambiguities; I apologize for being slightly short with you. Also, that's an epic hyphenated word in that post. Keep up the good work! |
@josh how about Being explicit in that it's a browser polyfill for fetch in the naming... regarding publishing to npm. |
@tracker1 it's published now as |
Better to have a single canonical name. |
For people interested in a node.js implementation: |
@bitinn good stuff |
@bitinn nice! I was waiting for someone to write just that. Mind opening a PR to cross link it from our README? I totally think anyone wanting to use fetch in just node.js should be using your lib instead. |
Because npm is the closest thing we have to a standard module repository for JavaScript (including the client-side). It's the largest module registry of its kind for any language. There are about 1/5th as many Bower modules as npm modules.
If that's not convincing enough: http://browserify.org/articles.html
The text was updated successfully, but these errors were encountered: