-
Notifications
You must be signed in to change notification settings - Fork 14
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
Replace Parcel with Rollup for manifest builder #389
Conversation
🦋 Changeset is good to goLatest commit: a3d2bac We got this. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The preview packages of this pull request have been published. @bigtest/atomInstall using the following command: $ npm install @bigtest/atom@rollup Or update your package.json file: {
"@bigtest/atom": "rollup"
} @bigtest/bundlerInstall using the following command: $ npm install @bigtest/bundler@rollup Or update your package.json file: {
"@bigtest/bundler": "rollup"
} @bigtest/effectionInstall using the following command: $ npm install @bigtest/effection@rollup Or update your package.json file: {
"@bigtest/effection": "rollup"
} @bigtest/globalsInstall using the following command: $ npm install @bigtest/globals@rollup Or update your package.json file: {
"@bigtest/globals": "rollup"
} @bigtest/interactorInstall using the following command: $ npm install @bigtest/interactor@rollup Or update your package.json file: {
"@bigtest/interactor": "rollup"
} @bigtest/serverInstall using the following command: $ npm install @bigtest/server@rollup Or update your package.json file: {
"@bigtest/server": "rollup"
} |
ab71bd2
to
b162ba0
Compare
a413781
to
9bdef65
Compare
@pittst3r 🥳 🎈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ought to simplify things considerably, way to turn a chore into an architectural upgrade!
); | ||
let bundlerEvents: ChainableSubscription<BundlerMessage, undefined> = yield subscribe(bundler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting case of whether to use subscribe
vs Subscribable.from
. The first subtle difference is that the first maps an actual live subscription, whereas the latter maps an operation that produces a subscription.
From a runtime perspective, subscribe()
produces a single subscription (tantamount to a single event listener) shared by both waitForSuccessfulBuild
and createManifestBuilder
vs two subscriptions, one at each site of iteration you would get from Subscribable.from
. From a code perspective, subscribe()
requires an extra yield
statement and type annotation.
Otherwise, they're identical. I'm not sure I understand the tradeoffs fully, but wanted to at least highlight the differences for this use-case so that we can collect more datapoints. /cc @jnicklas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One (fixable) problem with using Subscribable.from()
is the Chain
interface is not public, making type annotations with it impossible. This is not a great reason, but it was my deciding factor in this case. I do feel that subscribe()
may be a better fit though as we would otherwise be recursively creating new subscriptions in waitForSuccessfulBuild()
if I understand correctly.
As an aside, the overlap between Subscribable
and Chain
and ChainableSubscription
is confusing to me. Not sure if there's room to make the differences more clear and understandable or otherwise consolidate into fewer interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially wanted to remove Subscribable
entirely, but we left it in there, because we didn't know which type of chaining would turn out to be more useful, so we decided on keeping both. That being said, we could certainly improve on the naming of things to make it easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pittst3r seems like the right choice for a recursive method, although this is a very subtle distinction to ask users to
I wonder if we can make some shared interface that has all the chaining, and then have the low-level thing that just has next()
on it a SubscriptionIterator
. We might be able to use that chaining interface regardless of whether we're chaining the subscription or the operation.
Motivation
I was initially attempting to upgrade to parcel@2 because:
After struggling with this I noticed:
Approach
Rollup is a better fit for the problems at hand:
This PR switches to using Rollup for bundling the manifest.
To-do
Typechecking and linting of test code is still a problem. I was unable to get
@rollup/plugin-typescript
to behave well, so I fell back to using Babel to compile TypeScript, which does not do any typechecking. I think it may make sense to typecheck and lint as a separate step anyway if atsconfig.json
or.eslintrc.json
are found.