-
Notifications
You must be signed in to change notification settings - Fork 11
build(query-parser): replace gen-esm-wrapper with rollup COMPASS-10271 #611
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
base: main
Are you sure you want to change the base?
Conversation
|
Please update FYI @addaleax |
|
As you can see, this PR isn't currently passing CI. I think rollup is having trouble with our typescript config? In any case, I'm not sure how I feel about replacing our tooling because of |
I know, the
Seems that With this PR, you can also check inside the
Actually We need two different builds (CJS and ESM) or only ESM (new versions of We can use directly a build tool ( |
Right, the problem with rollup is that What rollup doesn't support is Using split builds might be the way to go in the long run, but it has its non-trivial downsides (e.g. object identity changing between the builds) and I'm not sure that it's a road we'd want to go down without discussing it on the team first |
Please can a discussion/issue be opened? |
|
Hey @rtritto! Thanks for the PR and for opening the ticket. We’re not planning to change the build setup in the short term. The issue this PR addresses is a Rollup limitation, and this proposal doesn't offer clear enough benefits to justify the effort right now. While we may revisit the build system in the future, gen-esm-wrapper does generate valid ESM that works with Node.js and other bundlers as expected This repo is shared across all our tooling, so even small config changes can impact first-tier components like mongosh or Compass. Given that, the risk and validation effort currently outweigh the benefits. From the linked issues it looks like the Rollup workaround unblocked you. Can you confirm that’s still the case? |
|
Hi @kmruiz, thanks for reply.
This isn't only a rollup issue/limitation because other bundle tools will have same trouble.
The change must be made on all tools as a breaking change (increasing the major version number), by this way, nothing will break.
The workaround doen't work for me (I closed the issue because the problem was here and not on standaloner/rollup side). |
From my understanding, that's not entirely correct. Both CJS and ESM support Object.defineProperty just fine, we are using webpack and everything is bundled accordingly. I understand that rollup does not detect this specific pattern, but other tools like webpack and Node.js through cjs-module-lexer work fine. We might want to change in the future the build system, but as mentioned earlier, the current system works as expected for mongosh, Compass and other products we maintain without substantial issues.
Currently we don't have the capacity to address this. Changing all our products, which are complex codebases with pretty advanced build systems is not something we are willing to do in the short term because of a limitation in rollup.
From what I see, standaloner is a native application packager. The only option we can give you at the moment is to use a native application packager that does not use rollup, so you can avoid this limitation. In our case, we use boxednode for mongosh because it supports native addons and it's bundler agnostic. |
Description
Replace
gen-esm-wrapperwithrollupRelated:
toJSStringis not a function nitedani/standaloner#8Checklist