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
Stop recommending node-globals/node-builtins plugin #2881
Comments
Good point. Maybe we should point people to rollup-plugin-inject instead, on which this plugin was based, and develop a meta-plugin that basically configures rollup-plugin-inject to inject node globals. The issue, however, is maintenance. As you have obviously put some thought into this, would you be willing to help with maintenance (i.e. checking issues, updating dependencies, I would grant you the necessary permissions to do so) if I set something up within the rollup organization? |
Sorry for taking so long, it's been a busy week :)
I will keep you tuned! |
Awesome! If you want to make it an official plugin at some point, let me know. |
@lukastaegert
Open questions, wondering if we should rollup the following dependencies:
to avoid the dependency hell this packages could introduce. |
I would be happy to maintain this plugin and make the rollup organisation adopt it. |
Nice one! I was wondering if I should suggest it considering the long term plan would be to move more and more of the Rollup ecosystem to TS but it seems you beat me to it 😉
Does not look like there would be lots of synergies with other plugins but who knows what transitive dependencies there are. As for licenses and dependencies, this is a nice tool: https://npm.anvaka.com/#/view/2d/browserify-fs Looks like including I am a little cautious about the browserify shims, they seem to have TONS of dependencies, some with questionable licenses. One could definitely experiment with bundling, an alternative could be not NOT make them a dependency but instead tell the user that they need to install this dependency if they enable that shim. Then we could try to do a dynamic import and if it fails, tell the user what they need to install. |
Rollup is doing this with |
Don't use browserify-fs. It is unmaintained for years. It is built on top of a very old version/implementation of level-db which includes many outdated dependencies within vulnerability. Some ideas:
|
is there some alternative to browserify-fs? i am also a fan of avoiding it. I got some nice bundling, making each dep a single .fs file, but I didn't though about the LICENSES. I hate dependencies by the way. |
I think i will updtae the deps to use what webpack uses. Which it's like the de facto standard https://github.com/webpack/node-libs-browser |
Sounds good. And don’t worry about licenses. I will try to fix this up for Rollup core the next days, there are some people at my company who should know a thing or two about FOSS licensing. Then we can think about what we need to write in the license for the bundled dependencies. But I think it is important we set a good precedent for these things as more libraries are starting to distribute bundled dependencies. |
Thanks perfects! thanks for your time in this issue!
Just released an initial version of it:
I am asking some users of stencil to use it in their apps, some had problems with dynamic imports, let's see how all this plays. |
Getting this in VS Code:
Stencil 1.0.1 Good old |
The error looks weird to me. Do you have any additional/external Rollup types installed? Especially this part is strange: |
@lukastaegert no worries, that error is related with stencil, we have some bad types, i will fix soon! unrelated with rollup :) |
As for the licensing, I hope we can extend rollup-plugin-license to gather all license texts in a single file to automatically include all dependencies without forcing us to manually maintain that file, see mjeanroy/rollup-plugin-license#379 |
Hey folks. This is a saved-form message, but rest assured we mean every word. The Rollup team is attempting to clean up the Issues backlog in the hopes that the active and still-needed, still-relevant issues bubble up to the surface. With that, we're closing issues that have been open for an eon or two, and have gone stale like pirate hard-tack without activity. We really appreciate the folks have taken the time to open and comment on this issue. Please don't confuse this closure with us not caring or dismissing your issue, feature request, discussion, or report. The issue will still be here, just in a closed state. If the issue pertains to a bug, please re-test for the bug on the latest version of Rollup and if present, please tag @shellscape and request a re-open, and we'll be happy to oblige. |
Reopening to track state of the new plugin |
@manucorporat I'd like to propose moving your plugin to the Rollup org. We think it's an important plugin and worth being backed by the org. Is that something you'd be cool with? |
@manucorporat ping. we're just about done with populating our new plugins monorepo and would like to bring this into the fold. Thoughts? |
and what's the final recommendation for using nodejs utilities? |
Since @manucorporat is MIA and https://github.com/ionic-team/rollup-plugin-node-polyfills is unmaintained (no commits for 1,5 year, no PRs merged) - what is the best approach/alternative? |
I'm using the alias plugin to map those modules to our own implementation: |
I guess we should just put a fork into the plugins monorepo and take it over from our side. Anyone willing to help here? |
Encountered this problem +1. Is there anything I can help with? |
If @shellscape agrees as well, what would need to be done is to create a PR for https://github.com/rollup/plugins that
I believe if someone starts with a PR that would just add the plugin as it is, more people can help with the additional steps needed to refine the PR. @shellscape would know more how to go about this best. |
For those who only using the https://www.npmjs.com/package/rollup-plugin-inject-process-env |
@yaquawa what do you mean? |
@lukastaegert that's a really, really big burden. a large portion of webpack's issues were driven by the node compat layer. this is one of those that I don't actually think should be in the plugins repo, but a separate fork under the guise of "we don't recommend using this, but if you really really have to, here it is" and let the community maintain it. To that end, maybe it should be its own project outside of the org. |
How about adding a "Recommended polyfills for Node.js builtin modules" section to rollupjs.org or https://github.com/rollup/plugins/tree/master/packages/commonjs? Then rollup can point people to the list and the alias/inject plugin. (maybe add some examples to plugin readme or the doc) |
@lukastaegert @shellscape we are having a lot of bug reports opened against the Vite repo because of the use of node globals. Looks like https://github.com/ionic-team/rollup-plugin-node-polyfills has not been updated lately. Do you have any insight on other projects that we could recommend? Note: with Webpack 5 dropping the shims, I think popular dependencies will get patched soon, so this pain may be good for the ecosystem in the long run. |
@matias-capeletto https://github.com/snowpackjs/rollup-plugin-polyfill-node is a good alternative and being maintained See also: rollup/plugins#51 (comment) |
Thanks a lot for the pointers @Niek, that are great news! 🎉 |
Dropped a PR to recommend |
* Stop recommending node-builtins. Closes #2881 * Update all occurrences of node-polyfills.
…ode-builtins We're getting Emitter is not a constructor errors in mud-lib, which might be an issue with the rollup-plugin-node-builtins package. rollup/rollup#2881 suggests that package should be replaced with rollup-plugin-polyfill-node
snowpackjs/rollup-plugin-polyfill-node has been deleted |
Oh no! I see that it's still there on NPM at least https://www.npmjs.com/package/rollup-plugin-polyfill-node I did some digging and found that:
Related thread rollup/plugins#51 (comment) |
Hi, All; thanks for all your great work on this great project. I am trying to upgrade an old repository from Rollup 1 to 4 (I know, I know, long overdue). I came across this post, but I don't have a clear direction on how to upgrade the following plugins:
What npm/yarn package should I use to support these features? If it's no longer required, can you point me in the right direction within the docs? Thanks in advance (I know this is not for an issue but more for a StackOverflow question), but I thought the subject of the original issue made my question relevant here. I apologise in advance 😉 if it wasn't the right place |
The docs recommend users to use
rollup-plugin-node-builtins
androllup-plugin-node-globals
if you code uses node APIS, but they are pretty much unmaintained.For example,
rollup-plugin-node-globals
uses a very old version of acorn instead ofthis.parse()
provided by rollup, making any build including a dynamic import() to crash.I would be great if the
rollup
organization forked this plugins or find some alternatives.We have submitted a couple of PRs fixing this plugins (since december of 2018), but they are not being merged.
The text was updated successfully, but these errors were encountered: