Giter VIP home page Giter VIP logo

cerebral-debugger's Introduction

Cerebral

A declarative state and side effects management solution for popular JavaScript frameworks

NPM version Build status Coverage Status bitHound Score Commitizen friendly Discord

Maintainer needed

https://gist.github.com/christianalfoni/f1c4bfe320dcb24c403635d9bca3fa40

Documentation

Contribute

The entire Cerebral codebase has been rewritten to encourage contributions. The code is cleaned up, commented and all code is in a "monorepo". That means you can run tests across projects and general management of the code is simplified a lot.

  1. Clone the monorepo: git clone https://github.com/cerebral/cerebral.git
  2. In root: npm install

The packages are located under packages folder and there is no need to run npm install for each package.

Using monorepo for your own apps

If you want to use Cerebral 2 directly from your cloned repo, you can create a symlinks for following directories into the node_modules directory of your app:

  • packages/node_modules/cerebral
  • packages/node_modules/function-tree
  • packages/node_modules/@cerebral

If your app and the cerebral monorepo are in the same folder you can do from inside your app directory:

$ ln -s ../../cerebral/packages/node_modules/cerebral/ node_modules/
# ...

Just remember to unlink the package before installing it from npm:

$ unlink node_modules/cerebral
# ...

Running demos

Go to the respective packages/demos/some-demo-folder and run npm start

Testing

You can run all tests in all packages from root:

npm test

Or you can run tests for specific packages by going to package root and do the same:

npm test

Changing the code

When you make a code change you should create a branch first. When the code is changed and backed up by a test you can commit it from the root using:

npm run commit

This will give you a guide to creating a commit message. Then you just push and create a pull request as normal on Github.

Release process

  • Review and merge PRs into next branch. It is safe to use "Update branch", the commit created by Github will not be part of next history
  • If changes to repo-cooker, clean Travis NPM cache
  • From command line:
$ git checkout next
$ git pull
$ npm install # make sure any new dependencies are installed
$ npm install --no-save repo-cooker # needed to test release, make sure you have latest
$ npm run release # and check release notes
$ git checkout master
$ git pull
$ git merge --ff-only next
$ git push

cerebral-debugger's People

Contributors

caycecollins avatar christianalfoni avatar guria avatar henri-hulski avatar marano avatar mikaelbr avatar reflog avatar talbergs avatar yusufsafak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cerebral-debugger's Issues

STATE-TREE not updated by "module" mutation

When I use cerebral version 4 module provider api to update state
eg.: module.merge('dimensions', dimensions)
where module has path 'app'.
In Cerbral Debugger: MUTATIONS tab shows the mutation but STATE-TREE tab has no data at path app.dimension:
app: { dimensions: { } }
But when I use state provider:
state.merge('app.dimensions', dimensions)
everything works -> STATE_TREE shows changed data right.

Cerebral Debugger is not starting up properly

I just installed the Cerebral Debugger on my Windows 10 computer.
When starting up, the program is just showing the brain logo in the middle with the text "Loading..." on the side.
It also opens a chromium devtools at the side with this error in the Console:

Failed to load resource: net::ERR_CONNECTION_REFUSED

If I press CTRL+R to reload, it shows:

GET http://localhost:9000/dist/bundle.js net::ERR_CONNECTION_REFUSED

cerebral_debugger_2018-11-27_11-00-11

Error when trying to change state or travel to a previous state

As discussed on Discord, while working on CodeSandbox and using the debugger (which, btw, is awesome!), I've noticed that when I try to edit the state, or travel to a previous state, I get this error in the browser and nothing happens:

Uncaught TypeError: this.state.runInBatch is not a function
    at Model.updateIn (Model.js:89)
    at Model.set (Model.js:141)
    at Devtools.onMessage (index.js:141)

debugger often crashes

Often, cerebral debugger crashes right when I start my application. Other times, it will be stable for a while and then eventually crash on a new page load. I'm not sure why it crashes sometimes and not others since my application code doesn't necessarily change between when it's working and when it crashes.

Is there anything I can do to help figure out what's going on? I'm on v3.0.1

image

TypeError: Cannot read property 'items' of undefined
at t.getActionNameByIndex (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:12:2668)
at Object.t.updateSignal [as function] (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:20:175442)
at e.value (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:40321)
at file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:45244
at r.executeBranchWrapper (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:43008)
at t (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:44472)
at file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:44770
at e.value (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:41527)
at file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:45244
at r.executeBranchWrapper (file:///Applications/Cerebral%20Debugger.app/Contents/Resources/app.asar/electron/build/bundle.js:1:43008)

Not working

Hello! I'm using stand-alone application. When I'm launching it and pass hostname and port, I don't know, what I must do next.
In my store configuration I define devtools like this:

devtools: NODE_ENV === 'dev' && DevTools({
    host: 'localhost:8585',
    reconnect: true
  }),

devtools passed to controller, but it throws errors, like Can't connect to localhost:8585, try to launch debugger on the same host and port.

Whats wrong?

Cannot connect to application

I've created React app using create_react_app and tried to connect it to a debugger. App is running on localhost:8585 and once I try to attach debugger to the address, debugger just displays empty state, no sequences, etc and if I refresh the page, I get the message Upgrade required on the page. Any clue what to do?

I tried to connect to app using 127.0.0.1:8585 as well, but the same occurs.

Packages:
cerebral: latest
@cerebral/react: 4.0.1
react: 16.6.0
react-dom: 16.6.0
react-scripts: 2.0.5

Debugger: 3.0.0

OSX High Sierra 10.13.3

Please consider upgrading electron version, as I try to package it for nixpkgs

I get a security warning when using electron in nixpkgs for versions 3 and 4, but the debugger seems to run. I am not able to make it run for electron version 5 (which still is flawed with security vulnerabilities).

Please consider upgrading to a newer version of electron. I am working on the package here:

scalavision/nixpkgs@0c6b65e

It would make it very easy for future developers to install it directly from the nix package manager.

Debug

Debug js.fileclaer.

Option for displaying full path of signal

I'd love to see a option toggle for displaying the full path of a signal in the Signals tab. I have multiple signals with the same name (e.g. "routed"), and it would be nice to see the full path.

To clairify, what I'd like to toggle is between this:

routed
routed
routed

and this

views.overview.routed
views.analysis.routed
views.login.routed

Cannot convert undefined or null to object

I'm on Fedora 28 Linux with stock Gnome.
I have configured my application to listen for a debugger and in the debugger trying to create a connection to the running project.
Following is what I receive immediately after specifying port and project name
image

Regular expressions shown as {} in the state tree view

Hi, the debugger (version 1.5.0) shows regular expressions used when defining Cerebral form validation as {} instead of showing the string representation.

Example:

  myForm: {
    salutationNameDE: {
      errorText: 'ungültig',
      isRequired: false,
      isValueRules: ['minLength:1'],
      validationRules: [/^[a-zA-ZäöüÄÖÜ0-9 ]*$/, 'maxLength: 10']
    }
  }

results in

  myForm: {
    salutationNameDE: {
      errorText: "ungültig",
      isRequired: false,
      isValueRules: ["minLength:1"],
      validationRules: [
        { },
        "maxLength: 10"
      ]
    }
  }

in the "STATE-TREE" debugger tab.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.