Skip to content

Commit 1fbf1ab

Browse files
authored
Merge pull request #15 from oslabs-beta/dev
Dev to Main PR
2 parents ef0e243 + a58cc6a commit 1fbf1ab

File tree

19 files changed

+6825
-1537
lines changed

19 files changed

+6825
-1537
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
/build

README.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,45 @@
1-
# react-labyrinth README
1+
# React Labyrinth
22

3-
This is the README for your extension "react-labyrinth". After writing up a brief description, we recommend including the following sections.
3+
![React Labyrinth Logo](./media/reactLabyrinthFinal.png)
44

5-
## Features
5+
# __Table of Contents__
6+
1. [Overview](#overview)
7+
2. [Features](#features)
8+
3. [Installation](#installation)
9+
4. [Getting Started](#getting-started)
10+
5. [Known Issues](#known-issues)
11+
6. [Release Notes](#release-notes)
12+
7. [Meet Our Team](#meet-our-team)
13+
8. [License](#license)
14+
15+
*work in progress as of 11/13/23*
16+
## Overview
17+
React Server Components are components that run exclusively on the server, allowing the components to do things such as making their own database queries inside of the component, rather than having to make a request to the backend first. These components are different from the components we usually write in React, which under this new paradigm are refered to as Client Components. But the problem is it's not always clear which Client Components could instead be Server Components which would save space on the bundle size and decrease TTI(time to interactive) for the client.
618

7-
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
19+
We want to create a visualization tool to help developers know where these changes could be implemented and how much time and space their application would save from these potential changes. _(Make sure to "trust our extension" in order to see the bundle size and TTI metrics)_
820

9-
For example if there is an image subfolder under your extension project workspace:
21+
## Features
22+
23+
Our tool will
24+
* Show which components are currently considered Client Components or Server Components
25+
* Show if a Client Component has the potential to be a Server Component.
26+
* Display the change in Bundle Size and TTI for the web application
1027

1128
\!\[feature X\]\(images/feature-x.png\)
1229

1330
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
1431
15-
## Requirements
32+
## Installation
1633

17-
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
34+
Our visualization tool can be downloaded as an extension in the VS Code Editor. Search for React Labrynth and click "install".
1835

19-
## Extension Settings
36+
## Getting Started
2037

21-
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
38+
Select the root file for your React App to load the tree.
2239

23-
For example:
40+
Any components that are Client Components will have a blue background and Server Components will have an orange background.
2441

25-
This extension contributes the following settings:
42+
If the component has the potential to be a Server Component, there will be an orange dotted outline surrounding the component node on the tree.
2643

2744
* `myExtension.enable`: Enable/disable this extension.
2845
* `myExtension.thing`: Set to `blah` to do something.
@@ -39,27 +56,15 @@ Users appreciate release notes as you update your extension.
3956

4057
Initial release of ...
4158

42-
### 1.0.1
43-
44-
Fixed issue #.
45-
46-
### 1.1.0
47-
48-
Added features X, Y, and Z.
49-
50-
---
51-
52-
## Working with Markdown
53-
54-
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
59+
## Meet Our Team
5560

56-
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
57-
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
58-
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets
61+
* Ashley Luu
62+
* Christina Raether
63+
* Francisco Lopez
64+
* Johnny Arroyo
65+
* Louis Kuczykowski
5966

60-
## For more information
6167

62-
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
63-
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
68+
## License
6469

65-
**Enjoy!**
70+
React Labrynth is developed under the [MIT license](https://en.wikipedia.org/wiki/MIT_License)

extension.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
// The module 'vscode' contains the VS Code extensibility API
2-
// Import the module and reference it with the alias vscode in your code below
31
const vscode = require('vscode');
2+
const { createPanel } = require('./src/panel');
3+
const { Parser } = require('./src/parser');
44

55
// This method is called when your extension is activated
66
// Your extension is activated the very first time the command is executed
77

8-
/**
9-
* @param {vscode.ExtensionContext} context
10-
*/
118
function activate(context) {
129

13-
// Use the console to output diagnostic information (console.log) and errors (console.error)
14-
// This line of code will only be executed once when your extension is activated
15-
console.log('Congratulations, your extension "react-labyrinth" is now active!');
16-
17-
// The command has been defined in the package.json file
18-
// Now provide the implementation of the command with registerCommand
19-
// The commandId parameter must match the command field in package.json
2010
let disposable = vscode.commands.registerCommand('react-labyrinth.helloWorld', function () {
21-
// The code you place here will be executed every time your command is executed
22-
23-
// Display a message box to the user
2411
vscode.window.showInformationMessage('Hello World from React Labyrinth!');
2512
});
2613

27-
context.subscriptions.push(disposable);
14+
// pass in the command we want to register (refer to package.json)
15+
let result = vscode.commands.registerCommand('myExtension.showPanel', () => {
16+
// call helper func
17+
createPanel(context);
18+
});
19+
20+
vscode.commands.registerCommand('myExtension.pickFile', async () => {
21+
const fileArray = await vscode.window.showOpenDialog({ canSelectFolders: false, canSelectFiles: true, canSelectMany: false });
22+
const tree = new Parser(fileArray[0].path);
23+
tree.parse();
24+
const data = tree.getTree();
25+
console.log('Data sent back: \n', data);
26+
createPanel(context, data);
27+
});
28+
context.subscriptions.push(disposable, result);
2829
}
2930

3031
// This method is called when your extension is deactivated
31-
function deactivate() {}
32+
// function deactivate() {}
3233

3334
module.exports = {
3435
activate,
35-
deactivate
36+
// deactivate
3637
}

jsconfig.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

media/favicon.ico

15 KB
Binary file not shown.

media/reactLabyrinthFinal.png

542 KB
Loading

media/test1.svg

Lines changed: 33 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)