Synchronize browser and node targets with monorepo targets#83
Conversation
|
I actually explicitly removed the targets recently, with the argument that addons are going to be built by Storybook's manager builder anyway, so it doesn't add much value to try and do that beforehand. In fact, keeping it as modern as possible probably slims down the addon package. The only thing that won't get built by Storybook is the presets/node side of things, so we need to ensure they are built to a target matching Storybook's. Although I also see this in the tsup docs:
Which in our case would mean that addons build for ES2023. Ideally they would build for esnext given the arguments above. But I'm actually okay with the changes here, to keep things more explicit. |
Sorry, I was OOO and couldn't get back to you in time to discuss this before merging. I agree with you that not having a browser target is better than having even an up-to-date one. My concern is that a lot of existing addons have out-of-date hardcoded targets, and people taking over these addons might find it easier to understand how to update targets if they see a new I'd like to leave this imported target for two major versions and then remove it, as there'll be few addons left with hardcoded targets. Does that sound acceptable to you? |
|
SGTM |
This PR ensures tsup builds with the same targets as Storybook. This is to avoid addon authors compiling for older targets and embedding polyfills for browsers that wouldn't run on Storybook anyway.
@JReinhold FYI assigning this to you as you last made changes to targets and I wanna make sure you're on board :)