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

[Low pri] Fix build for node v12.4.0 #1181

Merged
merged 8 commits into from
Jul 10, 2019
Merged

[Low pri] Fix build for node v12.4.0 #1181

merged 8 commits into from
Jul 10, 2019

Conversation

Tug
Copy link
Contributor

@Tug Tug commented Jun 26, 2019

Fixes build errors on node v12.4.0

To test:

  • nvm install --latest-npm
  • yarn start:reset
  • Check that you can build and run the app

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@Tug Tug added this to the 1.9 milestone Jun 26, 2019
@Tug Tug self-assigned this Jun 26, 2019
@Tug Tug changed the title Fix build for node v12.4.0 [Low pri] Fix build for node v12.4.0 Jun 26, 2019
@mchowning
Copy link
Contributor

The README still says that we need to use node v8.12.0. If that's no longer true it would be great to get that updated too.

@Tug Tug modified the milestones: 1.9, 1.10 Jul 8, 2019
@Tug
Copy link
Contributor Author

Tug commented Jul 9, 2019

This is still low priority but would help stay in sync with gutenberg as it now targets the latest npm.

@@ -130,13 +131,14 @@
"js-beautify": "^1.7.5",
"jsc-android": "236355.x.x",
"jsdom-jscore": "git+https://github.com/iamcco/jsdom-jscore-rn.git#a562f3d57c27c13e5bfc8cf82d496e69a3ba2800",
"jsdom-jscore-rn": "git+https://github.com/iamcco/jsdom-jscore-rn.git#a562f3d57c27c13e5bfc8cf82d496e69a3ba2800",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, do we have to have 2 lines/deps here even though they point to the very same commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added automatically by yarn upgrade, probably because the package it's pointing at was renamed jsdom-jscore-rn.
I think we should keep jsdom-jscore-rn only and update the imports here https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/globals.js#L7
Updating 👍

@hypest hypest modified the milestones: 1.10, 1.9 Jul 9, 2019
@hypest
Copy link
Contributor

hypest commented Jul 9, 2019

Do tests run fine locally for you @Tug ?

For most tests I get:

    Invariant Violation: Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)

      76 |  */
      77 | export default function useSelect( _mapSelect, deps ) {
    > 78 | 	const mapSelect = useCallback( _mapSelect, deps );
         | 	                  ^
      79 | 	const registry = useRegistry();
      80 | 	const isAsync = useAsyncMode();
      81 | 	const queueContext = useMemo( () => ( { queue: true } ), [ registry ] );

      at invariant (gutenberg/node_modules/react/cjs/react.development.js:88:15)
      at resolveDispatcher (gutenberg/node_modules/react/cjs/react.development.js:1436:28)
      at useCallback (gutenberg/node_modules/react/cjs/react.development.js:1486:20)
      at useSelect (gutenberg/packages/data/src/components/use-select/index.js:78:20)
      at gutenberg/packages/data/src/components/with-select/index.js:59:23
      at renderWithHooks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:4962:18)
      at mountIndeterminateComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6939:13)
      at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7544:16)
      at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11234:12)
      at workLoop (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11266:24)
      at renderRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11349:7)
      at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12237:7)
      at performWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12149:7)
      at performSyncWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12123:3)
      at requestWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11992:5)
      at scheduleWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11807:5)
      at scheduleRootUpdate (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12406:3)
      at updateContainerAtExpirationTime (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12434:10)
      at updateContainer (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12445:10)
      at Object.create (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12878:5)
      at Object.create (src/index.test.js:32:24)

@Tug
Copy link
Contributor Author

Tug commented Jul 9, 2019

Yep they run fine for me. Could you maybe try rm -rf gutenberg/node_modules?

@hypest
Copy link
Contributor

hypest commented Jul 10, 2019

Aha, I even though I don't use the nested gutenberg folder for running Gutenberg tests, I did have the gutenberg/node_modules in from an older experiment. Removing it did the trick, thanks @Tug .

@hypest
Copy link
Contributor

hypest commented Jul 10, 2019

Does this PR need to update the Gutenberg hash? Let's remove that change if not.

@Tug
Copy link
Contributor Author

Tug commented Jul 10, 2019

Does this PR need to update the Gutenberg hash? Let's remove that change if not.

Updated 👍

@Tug
Copy link
Contributor Author

Tug commented Jul 10, 2019

Tested on both node v10.16.0 and v12.6.0 with yarn install; yarn start:reset and then booting the demo app on android.

Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hypest hypest modified the milestones: 1.10, 1.9 Jul 10, 2019
@Tug Tug merged commit 5ec7042 into develop Jul 10, 2019
@Tug Tug deleted the fix/support-node-12.2plus branch July 10, 2019 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants