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

missing dependencies #187

Closed
dy opened this issue Mar 28, 2019 · 12 comments
Closed

missing dependencies #187

dy opened this issue Mar 28, 2019 · 12 comments

Comments

@dy
Copy link

dy commented Mar 28, 2019

Just yarn add react-use and got

Module not found: Can't resolve 'keyboardjs' in 'C:\projects\ACQ-Portal\node_modules\react-use\esm'
@dy dy changed the title keyboardjs dependency missing dependencies Mar 28, 2019
@dy
Copy link
Author

dy commented Mar 28, 2019

Same for

Module not found: Can't resolve 'rebound' in 'C:\projects\ACQ-Portal\node_modules\react-use\esm'

@dy dy mentioned this issue Mar 28, 2019
@scottc11
Copy link

also getting this.

@nino-moreton
Copy link

nino-moreton commented Mar 29, 2019

Also getting exactly
Module not found: Can't resolve 'keyboardjs' in 'C:\[myprojectname]\node_modules\react-use\esm'

Using v7.0.0

@streamich
Copy link
Owner

rebound and keyboardjs are now in peerDependencies and have to be installed separately, as some people were complaining about the large bundle size.

@Kosai106
Copy link

@streamich A bit tedious but I understand the reasoning for this.

@wardoost
Copy link
Contributor

wardoost commented Mar 30, 2019

I added a peer dependency note to the useKeyboardJs docs and aligned the useSpring docs with it. Less people should run into this issue now.

@soosap
Copy link

soosap commented Mar 31, 2019

These errors also appear when using useMouse as well.

If i use import useMouse from 'react-use/lib/useMouse' then these errors are not thrown. They appear the moment I use the following import style: import { useMouse } from 'react-use'.

Is there a way to fix the error for the latter import style?

@wardoost
Copy link
Contributor

@soosap The error will show up no matter what hook you are importing. As far as I know there are 2 ways to avoid the error and use the import { useMouse } from 'react-use' import style:

  1. Install peer dependencies or
  2. Use a babel transform plugin as described in Remove large dependencies #102 (comment)

@vinkla
Copy link

vinkla commented Apr 10, 2019

I'm also seeing this error even when I'm only importing useTitle:

import { useTitle } from 'react-use';

If I switch to use the full path (as suggested by @soosap) the error doesn't show:

import useTitle from 'react-use/lib/useTitle';

@chandlervdw
Copy link

Happens with useScroll, too. While it works, @vinkla's fix shouldn't have to be the case.

@wardoost
Copy link
Contributor

@vinkla Methods of importing are documented in the usage section in the readme. This question seems to come back a lot though. Any suggestions how this can be documented better? Or a fix would even be better of course @chandlervdw?

@vinkla
Copy link

vinkla commented Apr 27, 2019

@wardoost I guess what I found confusing was that one could use both named imports or full path. In my case though, I wasn't able to import useTitle without the full path.

Saeris added a commit to codesandbox/codesandbox-client that referenced this issue Jun 28, 2019
Updated some react-use and react-spring to their latest in-range versions.

Added rebound and keyboardjs as recommended by this issue: streamich/react-use#187

Sandbox Info should all work now!
SaraVieira added a commit to codesandbox/codesandbox-client that referenced this issue Jul 3, 2019
* start

* add styles

* move checkbox to common

* move template to common

* add hooooookd fam

* add actions

* add

* start modal

* start dashboard

* add color

* much progress on modal

* fix non logged in

* add empty state

* small fixes

* fix filtering

* update yarn lock

* final sandbnox modal fixes

* Update packages/common/src/components/Template/elements.ts

Co-Authored-By: Michaël De Boey <[email protected]>

* Small design tweaks

- Make the tabs animate on hover
- Remove main animation of screen, feels bit faster

* add edit and delete

* upadte state

* add hover

* ✨ Add Frozen/Editing Indicator, Apply Coding Conventions to Header (WIP)

Refactored a bunch of the Header components for better organization and to conform to coding conventions.

Added a new HazardButton primitive and used it to create a ToggleFrozenButton for the Sandbox Header. This button has the same effect as the Frozen toggle switch inside of the Project Info workspace and is used to give the user a visual indicator that they are viewing a frozen or editable sandbox.

TODO:
- Maybe move the HazardButton to common components and improve it's styling API. Could also use better types.
- Change the Fork button to show 'Use Template" when the current Sandbox is a Template. This would create a new Sandbox using the Template, but would sever the link to source GitHub repository, which the current Fork method preserves.
- Maybe rearrange the Header buttons?
- Continue refactoring remaining Header components to apply coding conventions.

* update state on start and edit

* 🔨 Refactor remaining Header components, Move onClick to Action container

Converted all Header sub-components to TypeScript using React Hooks.

As requested by @CompuIves, fixed the Action button behavior for onClick events, moving it from being triggered from clicks on the Icon to clicks on the container element.

* Update packages/app/src/app/pages/Sandbox/Editor/Header/Buttons/HazardButton/types.ts

Co-Authored-By: Michaël De Boey <[email protected]>

* add indicators

* add naming

* clean reload

* pr updates

* make components

* move to ts

* add gh check

* add warning modal

* remove header button0

* add store hooks

* Update packages/app/src/app/pages/Sandbox/Editor/Workspace/items/NotOwnedSandboxInfo/NotOwnedSandboxInfo.tsx

Co-Authored-By: Michaël De Boey <[email protected]>

* Update packages/app/src/app/pages/Sandbox/Editor/Workspace/items/NotOwnedSandboxInfo/NotOwnedSandboxInfo.tsx

Co-Authored-By: Michaël De Boey <[email protected]>

* pr fixes

* Update packages/common/src/components/Tags/index.tsx

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/app/src/app/store/modules/workspace/sequences.js

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/app/src/app/store/modules/workspace/sequences.js

Co-Authored-By: Ives van Hoorne <[email protected]>

* pr fixers

* pr fixes

* revert deleted files

* fix now.json

* fix yarn

* fix icons

* fix ts

* Update packages/app/src/app/pages/Dashboard/Content/routes/PathedTemplates/index.js

Co-Authored-By: Michaël De Boey <[email protected]>

* Update packages/app/src/app/pages/Dashboard/Content/routes/PathedTemplates/index.js

Co-Authored-By: Michaël De Boey <[email protected]>

* Update packages/app/src/app/pages/Sandbox/Editor/Header/Buttons/Action/types.ts

Co-Authored-By: Michaël De Boey <[email protected]>

* Update packages/app/src/app/pages/Sandbox/Editor/Header/index.tsx

Co-Authored-By: Michaël De Boey <[email protected]>

* Update packages/app/src/app/pages/Dashboard/Content/routes/PathedTemplates/Folders.js

Co-Authored-By: Michaël De Boey <[email protected]>

* simplyfy types

* 🔨 Apply Coding Conventions to CreateNewSandboxModal

Applied our coding conventions, reorganized, and converted most of the CreateNewSandbox files to TypeScript.

Was unabled to refactor CreateNewSandbox/index.js as I wasn't quite sure about how it works. @CompuIves you may want to take a shot at this or otherwise I'll just have to come back to it later.

Tested locally, all the functionality appears to be the same as before.

* fix lint

* 🚧 WIP - Change file extensions on PathedTemplates/Navigation

* 🧹 Cleanup PathedTemplates/Navigation

Converted to TypeScript and applied coding conventions.

* 🧹 Cleanup PathedTemplates

Applied coding conventions and added types.

It's worth noting that I was unable to add types for react-router-dom without having to upgrade multiple dependencies, which quickly grew outside of the scope of this PR. So instead proper types will be added at a later date once the build process and project dependencies are overhauled.

* fx ts

* 📦 Update Apollo Dependencies to Latest

Verified to solve type checking errors in app

Ran lint, test, typecheck, and ran a cold start, all passed. Tested locally to verify graphql queries still worked

* Rename prop

* Capitalize titles

* Remove spaces from css rules

This should fix these rules not displaying properly

* Update packages/app/src/app/store/modules/workspace/sequences.js

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/app/src/app/store/modules/workspace/sequences.js

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/app/src/app/pages/Sandbox/Editor/Workspace/items/NotOwnedSandboxInfo/NotOwnedSandboxInfo.tsx

Co-Authored-By: Ives van Hoorne <[email protected]>

* Fix types

* Regenerate yarn.lock

* Reset yarn cache

* Refactor templates to remove path logic

* add converted; make width in before 56px

* Reset sidebar active style

* Add team templates, make the icon white on hover

* Put module.ts back from master, it's fixed with old yarn.lock

* move to common

* 🔨 Apply new design to ForkFrozenSandboxModal

* Fix typecheck

* 🔧 Fix common/Button children Type

Always use `React.ReactNode` for the `children` prop.

* add grid

* remove public checkbox

* fix lint

* 0fix descriptrion

* Support team templates

* 🔨 Apply new design to TempalteModal

Also applied padding changes to ForkFrozenSandboxModal and added a 8px border radius to all modal containers.

* fix minor card issues

* fix overflow

* Don't show modal asking for fork for custom templates

* Fix menu bar styling

* ⚡️ Swap Buttons on ForkFrozenSandboxModal, Add react-use

As requested by Bas, the Fork and Unlock buttons have been swapped and there is now an event listener on the Fork button to fork the sandbox on pressing "enter", which is handled by `useKeyPressEvent` from `react-use`.

* Changes based on our ideas yesterday

- Make the template title and description from the sandbox
- Hide templates from "My Sandboxes" and "Recent Sandboxes"
- Update header to not show folders for templates

* fix weird jumping behavior

* fix plus button on header

* fix description

* 📝 Fix Types on common/Button and app/TemplateModal, Upgrade TypeScript

Upgraded TypeScript to the latest version across all packages.

Fixed typechecck errors caused by missing/incorrect types.

* 📝 Fix Types on NewSandboxModal/MyTemplates

* fix header

* Dashboard sandbox improvements

* Add context menu item

* Fix context menu hover width

* design changes0

* Fix template xolor

* Fix type errors

* fix the title of the sandbox

* Fix the height of templates

* Fix

* Fix caching logic

* Fix a type

* Fix another type issue

* Show templates for deleted sandboxes

* Filter templates in client

* Fix template count

* Show team templates in modal

* some fixes

* Fix all templates

* Support template forking inside new sandbox modal

* 🔨 Refactor Sandbox Info, Add Template Config

WIP commit updating the Sandbox Info workspace to add template configuration controls according to Bas's design in Figma. Still requires testing and fine tuning.

* Allow exporting templates

* 🔧 Fix Sandbox Info, Add missing Peer Dependencies for react-use

Updated some react-use and react-spring to their latest in-range versions.

Added rebound and keyboardjs as recommended by this issue: streamich/react-use#187

Sandbox Info should all work now!

* 👕 Fix Linting Errors in Modals + Editor

* Fixes

* make notlogged in modal

* pr comments

* tweaks|

* add docs

* add tooltip to tenmplate in the header

* Tweaks

* Last fixes

* Fix lint

* Client

* More fixes

* Tweaks

* Patron fixes

* Style tweaks

* move template color to common

* add margin-top back on gh page

* 📚 (WIP) Add Documentation for Templates, Environment, Add Blog Post

Documentation for Templates still needs gifs. The blog post also needs the existing images replaced with gifs, and the Roadmap section needs to be completed as well, perhaps with additional closing thoughts.

Environment documentation is merely a draft and needs to be finished before it can be published.

* Remove mention of template from sidebar

* Fix types

* Improve types

* Move template filter to be environment filter

* Tweak styling of sandboxes in new sandbox modal

* Don't show templates in search results

* Make replaceHistory the default for name changes

* 📚 Update Roadmap section of Templates Blog Post

* Remove onMouseDown listener

* add gifs

* Update packages/homepage/content/articles/templates.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/homepage/content/articles/templates.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/homepage/content/articles/templates.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/homepage/content/articles/templates.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/homepage/content/articles/templates.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/homepage/content/docs/6-templates.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Apply suggestions from code review

Co-Authored-By: Ives van Hoorne <[email protected]>

* Update packages/homepage/content/docs/7-environment.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* Apply suggestions from code review

Co-Authored-By: Ives van Hoorne <[email protected]>

* Apply suggestions from code review

Co-Authored-By: Ives van Hoorne <[email protected]>

* Add a bit of tracking

* 🎨 Crop Template Documentation Gifs

Removed browser address bar from all Templates gifs

* Fix modal showing in dashboard

* Style hovers

* 📚 Change wording on Client Environment configuration

* Sidebar fixes

* fix gifs in docs

* Update packages/homepage/content/docs/7-environment.md

Co-Authored-By: Ives van Hoorne <[email protected]>

* chnage to io

* 📚 Add Container Environment Explanation, Remove Bundlers

We'll add explanations for Bundlers at a later date.

* fix cards

* add environment link

* Apply suggestions from code review

Co-Authored-By: Ives van Hoorne <[email protected]>

* change cover image

* fix color picker

* remove alpha

* delete template modal

* 📚 Replace images in Templates Blog Post, Add More Details to Environment

* Remove template modal

* fix ts

* fix gatsby
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

No branches or pull requests

9 participants