Skip to content

INSPECT #506

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

Merged
merged 47 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
df99398
update js-slang imports, and use null for empty list
openorclose Jan 8, 2019
3ac7925
pass tests
openorclose Jan 8, 2019
083e100
pass tests
openorclose Jan 8, 2019
e42bccf
format all external libraries with prettier
openorclose Feb 4, 2019
0588d8f
Merge branch 'master' into update-js-slang
openorclose Feb 4, 2019
1b33af9
Update README.md
openorclose Feb 7, 2019
399cfdb
update js-slang to version 0.2.0
openorclose Feb 13, 2019
349b0d8
Merge remote-tracking branch 'origin/master' into update-js-slang2
openorclose Feb 13, 2019
29e1c09
update acorn, fix order of imports
openorclose Feb 13, 2019
3858146
update readme
openorclose Feb 13, 2019
01923f2
Merge remote-tracking branch 'origin/master' into update-js-slang2
openorclose Feb 13, 2019
ed59e50
unbump enzyme
openorclose Feb 14, 2019
4932de9
Merge remote-tracking branch 'origin/master' into update-js-slang2
openorclose Feb 14, 2019
4e9c95a
just adding compatability with js slang debugger
podocarp Feb 20, 2019
b3fde25
overlooked something minor
podocarp Feb 20, 2019
d16e0f8
pulled in upgrades from wkk
podocarp Mar 1, 2019
d4d34d9
added primitive inspector features
podocarp Mar 1, 2019
623e6d4
enabled the execution of commands in the REPL
podocarp Mar 2, 2019
c27bbc6
polished inspector output table
podocarp Mar 2, 2019
a07e9dd
changed icons according to feedback
podocarp Mar 13, 2019
e392257
added alert animation for sidecontent icons
podocarp Mar 13, 2019
8f6e0eb
fixed some small issue with alerted icons not turning off
podocarp Mar 14, 2019
ac5b568
added multiple features:
podocarp Mar 20, 2019
94394d3
minor fix to pass test
podocarp Mar 20, 2019
05a174e
changed highlighting to match new slang
podocarp Mar 23, 2019
c623e27
Basic ENV visualizer integration
lumos309 Mar 24, 2019
7fe2795
Removed working "console.log"
lumos309 Mar 24, 2019
b2497d7
added minor cosmetic tweaks
podocarp Mar 27, 2019
8b69816
merged
podocarp Mar 27, 2019
941fc46
merge from master
podocarp Mar 27, 2019
944c062
merge from master
podocarp Mar 27, 2019
0b821b3
merged
podocarp Mar 27, 2019
99f332c
changed which line was highlighted to suit new model
podocarp Mar 28, 2019
01f1a6c
filtered some noise from the inspector
podocarp Mar 28, 2019
61c9902
updated readme
podocarp Apr 8, 2019
af805f3
merge from master
podocarp Apr 8, 2019
25bb29d
moving env visualizer to its own branch
podocarp Apr 13, 2019
382a8d3
Merge from master
podocarp Apr 13, 2019
700097d
Merge branch 'master' into debugger
podocarp Apr 13, 2019
53b2a4f
Fixed repl error with executing while paused, enabled pausing arbitra…
podocarp Apr 14, 2019
92b66f8
prevent inspector dying from undefined context
podocarp Apr 14, 2019
b7d30bc
merge master
podocarp Apr 15, 2019
b6aaea3
fix highlighting issue
podocarp Apr 17, 2019
3dea612
use official js-slang
podocarp Apr 17, 2019
ef83ff4
merge from master again
podocarp Apr 17, 2019
9f82281
fixed spurious output in inspector for things like lists
podocarp Apr 18, 2019
6a87dc7
fix prettier
podocarp Apr 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ Note that this copies your files over, any future changes will not be reflected.

You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af) for a smoother experience.

## Inspector
This requires the use of the `debugger` branch of js-slang to work. Clone both the frontend and the `debugger` slang to the same directory. You would want to `yarn build` the slang you just obtained and then `yarn && sudo yarn start` in the frontend and it should just work. The merge over there is still ongoing. Meanwhile, please try to break this.

The mental model we are using is: A breakpoint means that the interpreter will stop right before it. Whatever is highlighted is going to be evaluated next. If you meet any inconsistencies with this, also please raise it up for discussion.

### What you can do
- Set breakpoints by clicking on the gutter
- `debugger;` just like ECMAScript
- Inspect!
- Run stuff in the context of the paused program!

### Usage
Here's what happens: After you click run, if there the interpreter meets a breakpoint, the first thing you're going to notice is that the REPL feedbacks to you it hit a breakpoint, the line is highlighted, and one of the icons on the right pane is going to start blinking. If you click on the icon, it reveals the inspector. All the variables in every frame is exposed here. The REPL is also now in the context of where ever you are. So you can evaluate anything you would normally be able to in the REPL. It is all quite simple really.

### Note
Because we use a local version of `js-slang`, the CI just breaks all the time.

## For Editing And Creating New Local XML Missions

1. Use the branch 'mission-editing' in cadet-frontend
2. Run in browser with npm start
2. Go to Incubator tab.

## Application Structure

1. `actions` contains action creators, one file per reducer, combined in index.
Expand All @@ -64,4 +87,4 @@ You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94

## TypeScript Coding Conventions

We reference [this guide](https://github.com/piotrwitek/react-redux-typescript-guide).
We reference [this guide](https://github.com/piotrwitek/react-redux-typescript-guide).
93 changes: 93 additions & 0 deletions README.md.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Cadet Frontend

[![Build Status](https://travis-ci.org/source-academy/cadet-frontend.svg?branch=master)](https://travis-ci.org/source-academy/cadet-frontend)
[![Coverage Status](https://coveralls.io/repos/github/source-academy/cadet-frontend/badge.svg?branch=travis)](https://coveralls.io/github/source-academy/cadet-frontend?branch=travis)

## Development Setup

1. Install a stable version of NodeJS (tested: Node 10.15.0).
2. Run `npm install` to install dependencies.
3. Copy the `.env.example` file as `.env` and set the variable `REACT_APP_IVLE_KEY`
to contain your IVLE Lapi key.
4. Run `npm start` to start the server at `localhost:80`. Admin permissions may
be required for your OS to serve at port 80.
5. If running cadet without ngix, `npm run cors-proxy` to solve CORS problems.

## IVLE LAPI Key
For NUS students, you can access your IVLE LAPI key [here](https://ivle.nus.edu.sg/LAPI/default.aspx).

## For Windows Users

### Running cadet-frontend
Run `npm run win-start`

### Dealing with hooks
In package.json, change line 28:\
"pre-push": "bash scripts/test.sh",\
to an empty line.

Please note that doing this will disable the test suite, so you will need to run the tests manually instead. Using Git Bash (or any other UNIX-based command line), run the following:\
cd scripts\
bash test.sh

## js-slang

Currently using a version of js-slang with native and verbose errors.

Edit https://github.com/source-academy/cadet-frontend/blob/57ba44f6b55c214d0f20339cd45bece57f24f48c/src/sagas/index.ts#L260

to toggle native (default is native enabled).

### To run local copy of js-slang

1. Follow the instructions on the js-slang repository to transpile your own copy
2. Edit line 41 of package.json in this project to link to the directory of your js-slang and then run `npm install`:

`"js-slang": "file:path/to/js-slang",`

Note that this copies your files over, any future changes will not be reflected.

You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af) for a smoother experience.

<<<<<<< HEAD
## Inspector
This requires the use of the `debugger` branch of js-slang to work. Clone both the frontend and the `debugger` slang to the same directory. You would want to `yarn build` the slang you just obtained and then `yarn && sudo yarn start` in the frontend and it should just work. The merge over there is still ongoing. Meanwhile, please try to break this.

The mental model we are using is: A breakpoint means that the interpreter will stop right before it. Whatever is highlighted is going to be evaluated next. If you meet any inconsistencies with this, also please raise it up for discussion.

### What you can do
- Set breakpoints by clicking on the gutter
- `debugger;` just like ECMAScript
- Inspect!
- Run stuff in the context of the paused program!

### Usage
Here's what happens: After you click run, if there the interpreter meets a breakpoint, the first thing you're going to notice is that the REPL feedbacks to you it hit a breakpoint, the line is highlighted, and one of the icons on the right pane is going to start blinking. If you click on the icon, it reveals the inspector. All the variables in every frame is exposed here. The REPL is also now in the context of where ever you are. So you can evaluate anything you would normally be able to in the REPL. It is all quite simple really.

### Note
Because we use a local version of `js-slang`, the CI just breaks all the time.

## For Editing And Creating New Local XML Missions

1. Use the branch 'mission-editing' in cadet-frontend
2. Run in browser with npm start
2. Go to Incubator tab.

=======
>>>>>>> master
## Application Structure

1. `actions` contains action creators, one file per reducer, combined in index.
2. `assets` contains static assets.
3. `components` contains all react components.
4. `containers` contains HOC that inject react components with Redux state.
5. `mocks` contains mock data structures for testing
6. `reducers` contains all Redux reducers and their state, combined in index.
7. `sagas` contains all Redux sagas, combined in index.
8. `slang` contains the source interpreter.
9. `styles` contains all SCSS styles.
10. `utils` contains utility modules.

## TypeScript Coding Conventions

We reference [this guide](https://github.com/piotrwitek/react-redux-typescript-guide).
Loading