storybookjs / telejson

🛰 JSON parse & stringify with support for cyclic objects, functions, dates, regex, infinity, undefined, null, NaN, Classes, Instances
MIT License
169 stars 29 forks source link

remove optional chaining because webpack 4 does not support it, and bringing support to it is far harder. #87

Closed ndelangen closed 1 year ago

ndelangen commented 1 year ago

This removed optional chaining in the source code, which remains in the dist because of our compilation target.

This syntax is a problem for webpack4, because it's internal parser is outdated.

Webpack4 is still used in the experimental version of storybook for react-native that @dannyhw is working on.

Of course this will eventually be replaced by webpack 5, or better yet, a completely prebuild manager like in storybook 7.0. Till that time, it's best to avoid overly complex solutions on react-native side, and just not use this one feature. A small cost to pay for easy of use elsewhere.