[Pkg-javascript-devel] babel 7 bootstrap problem and reify
Pirate Praveen
praveen at onenetbeyond.org
Tue Jan 21 09:10:18 GMT 2020
On ചൊ, Jan 21, 2020 at 14:28, Pirate Praveen
<praveen at onenetbeyond.org> wrote:
>
>
> On ചൊ, Jan 21, 2020 at 13:20, Pirate Praveen
> <praveen at onenetbeyond.org> wrote:
>>
>>
>> On തി, Jan 20, 2020 at 21:45, Pirate Praveen
>> <praveen at onenetbeyond.org> wrote:
>>> Hi,
>>>
>>> Just came across this module today https://github.com/benjamn/reify
>>> I was wondering if we could use this module to load ES6 files of
>>> babel directly (as we are stuck trying to build babel 7 and it
>>> needs babel 7 to build).
>>>
>>> Comments?
>>>
>>> Praveen
>>>
>>
>> With the following lines in .babelrc, some packages/* can be build
>> with babeljs 6.
>>
>> {
>> "presets": [
>> "env",
>> "flow"
>> ],
>> "plugins": [
>> [
>> "transform-object-rest-spread",
>> ]
>> ],
>> }
>>
>> babeljs packages/babel-plugin-proposal-class-properties/src -d
>> packages/babel-plugin-proposal-class-properties/lib
>>
>> packages/babel-plugin-proposal-class-properties/src/index.js ->
>> packages/babel-plugin-proposal-class-properties/lib/index.js
>>
>> But some packages are using babel 7 only plugins. For example,
>> building babel-core fails with this error. Anyone knows which
>> plugin is used here?
>>
>> babeljs packages/babel-core/src/ -d packages/babel-core/lib
>> SyntaxError: packages/babel-core/src/config/caching.js: Unexpected
>> token (49:56)
>> 47 | handler: (ArgT, CacheConfigurator<SideChannel>) =>
>> Handler<ResultT> | ResultT,
>> 48 | ): (ArgT, SideChannel) => Handler<ResultT> {
>> > 49 | return makeCachedFunction<ArgT, ResultT, SideChannel,
>> *>(WeakMap, handler);
>> | ^
>> 50 | }
>> 51 |
>> 52 | export function makeWeakCacheSync<ArgT, ResultT, SideChannel>(
>
> Jishnu identified it as flow syntax and probably we can get rid of it
> with an updated version of
> https://www.npmjs.com/package/flow-remove-types
And this requires packaging flow-parser which is written in OCaml.
Anyone here familar with OCaml? Any comments if this route is worth
pursuing?
More information about the Pkg-javascript-devel
mailing list