Skip to content
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

Babel 7 compatibility #211

Closed
wants to merge 6 commits into from
Closed

Babel 7 compatibility #211

wants to merge 6 commits into from

Conversation

vjpr
Copy link

@vjpr vjpr commented Jul 10, 2018

Babel 6 still used for compiling itself.

Not ready for merging, still contains stray commented-out debugging, etc.

@gajus
Copy link
Owner

gajus commented Aug 3, 2018

Not ready for merging, still contains stray commented-out debugging, etc.

Ping me when it is ready to merge.

@0rvar
Copy link
Contributor

0rvar commented Aug 13, 2018

Babel 7 RC has been released

@0rvar
Copy link
Contributor

0rvar commented Aug 28, 2018

Babel 7 has been released!

Repository owner deleted a comment from JacopKane Sep 3, 2018
@MateusDantas

This comment has been minimized.

@semireg

This comment has been minimized.

@gajus
Copy link
Owner

gajus commented Oct 31, 2018

I will be hiding comments that are written with the sole intention of bumping the thread.

Everyone is welcome to contribute to the repository.

@vjpr Has already done a lot of work. I am not up to date with the codebase to judge how much more work needs to be done. If someone is up for taking over from @vjpr, I am happy to assist with the review/ community/ release.

@semireg
Copy link

semireg commented Oct 31, 2018

@vjpr, @gajus, I'd like to help test. Hopefully I can be of assistance.

I've forked vjpr's repo and cloned it one directory above my project root. From here, I added the packages using:

yarn add --dev ../flow-runtime/packages/babel-plugin-flow-runtime/
yarn add --dev ../flow-runtime/packages/flow-runtime

Resulting in package.json:

    "@vjpr/babel-plugin-flow-runtime": "../flow-runtime/packages/babel-plugin-flow-runtime/",
    "@vjpr/flow-runtime": "../flow-runtime/packages/flow-runtime",

.babelrc contains:

{
  "presets": ["module:metro-react-native-babel-preset"],
  "env": {
    "production": {
    },
    "development": {
      "plugins": [
        [
          "@vjpr/flow-runtime",
          {
            "assert": true,
            "annotate": true
          }
        ]
      ]
    }
  }
}

When I run "native-react bundle" (see actual command) I receive this error:

index.js: Cannot find module './lib'

Error: Cannot find module './lib'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/devuser/local-dev/rn/RNSemiBoilerplate/node_modules/@vjpr/babel-plugin-flow-runtime/babel-plugin-flow-runtime.js:1:80)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)

Am I going about the installation correctly? Thanks!

@gajus
Copy link
Owner

gajus commented Oct 31, 2018

I do not expect this branch to work out of the box.

Ensuring that the local tests pass, would the next logical step.

@semireg
Copy link

semireg commented Nov 1, 2018

I spent some time working on this.

lerna success run Ran npm script 'test' in packages:
lerna success - babel-plugin-flow-prepack
lerna success - @vjpr/babel-plugin-flow-runtime
lerna success - flow-config-parser
lerna success - flow-runtime-cli
lerna success - flow-runtime-docs
lerna success - flow-runtime-mobx
lerna success - flow-runtime-validators
lerna success - @vjpr/flow-runtime

See https://github.com/semireg/flow-runtime/commits/vjpr/babel-7

TLDR:
• semireg@2d2f6cc
• semireg@701af95
• I moved the two @vjpr packages out of their own namespace so the project would build cleanly.

(Unfortunately, after all this, my actual project still has the same error TypeError: Property value expected type of string but got object. Oh well, progress!)

Fwiw, index.js: Cannot find module './lib' is simply caused by the project not being built.

@voodee

This comment has been minimized.

@jedwards1211
Copy link
Collaborator

jedwards1211 commented Dec 13, 2018

I can only dedicate so much of my work hours to this, but I'm taking a look now to see what I can contribute. This is definitely starting to become an albatross for my codebase since Babel 6 doesn't support explicit function type parameters, which are required in some cases by Flow >= 0.85.

@jedwards1211
Copy link
Collaborator

For anyone trying to contribute to this, my branch is https://github.com/jedwards1211/flow-runtime/tree/jedwards1211/babel-7
So far I've just upgraded the build and test deps in babel-plugin-flow-runtime (including Babel 7)

@jedwards1211
Copy link
Collaborator

I've made a PR to @vjpr's fork that fixes the test failures. Working on upgrading the rest of the subpackages to Babel 7 and various other modernizations...

@jedwards1211
Copy link
Collaborator

jedwards1211 commented Dec 14, 2018

Just encountered this bug while trying to build flow-runtime with Babel 7:
babel/babel#9189

@0rvar
Copy link
Contributor

0rvar commented Jan 8, 2019

What's the status on Babel 7 compatibility? Do you need any help? Is @phpnode or @gajus ready to merge this as soon as it's ready?

@gajus
Copy link
Owner

gajus commented Jan 8, 2019

I am happy to merge this as soon as it is ready.

@jedwards1211
Copy link
Collaborator

Okay, I merged these changes in 4f1702b

Will try to release it ASAP

@jedwards1211
Copy link
Collaborator

Okay now I just need to get publish permission for the babel-plugin-flow-runtime from @phpnode (he intends for me to have publish permission on everything but it doesn't seem to be configured yet).

@jedwards1211
Copy link
Collaborator

Okay everyone, this has been released in v0.18.0! Over the next few days I'll try to work on fixing flow errors in flow-runtime and upgrading other packages to Babel 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants