GithubHelp home page GithubHelp logo

Comments (7)

chrisjpatty avatar chrisjpatty commented on June 9, 2024 1

Sorry for the late reply, yes, it requires installation in a React project. Flume is best used in projects with fairly diverse logic requirements so there's some inherent assumptions that developers who need it will previously understand the basics of React. create-react-app is a great place to get started as you have. It looks like the error you're running into above is because your config.js file is not available relative to your App.js file. In the folder structure of your React project, your config.js file should be like this:

/src
   ├─ App.js
   ├─ config.js

However, keep in mind that this is only required for this specific example. You can create and store your configuration anywhere you like in your project, and then import and pass it to the NodeEditor component.

from flume.

netgfx avatar netgfx commented on June 9, 2024 1

I found the issue, on the config.js it needs export { config }; at the end

and on App.js import { config } from "./config"; to read it.

I think it would be nice to be included in the documentation. But I get that is something very basic and trivial.

from flume.

chrisjpatty avatar chrisjpatty commented on June 9, 2024

Hey @netgfx, thanks for trying out Flume! The quick start guide can help you get started with a basic setup, it's available here: Flume Quick Start

I'm in the process of working on a contributors guide which will have instructions for using the example directory. Is there a specific problem you're having trying to get started?

from flume.

netgfx avatar netgfx commented on June 9, 2024

Thanks for the quick response. From the link that you shared along with other documentation I take it that flume requires a basic npm setup and the reactjs to be installed. Is anything else required?
I know it may sound very beginner like, but I believe it would be helpful if the guide assumed that all I had was an empty folder, what steps would I need to take to have the most basic functionality of flume and view that locally in my browser.

from flume.

netgfx avatar netgfx commented on June 9, 2024

@chrisjpatty So what I did was to install the default react project via npx create-react-app my-app then do npm install flume then create the config.js file as described here: https://flume.dev/docs/basic-config
and change the default App.js like this:

import React from 'react';
import logo from './logo.svg';
import './App.css';
import { NodeEditor } from 'flume'
import config from './config'

function App() {
  return (
   <div style={{width: 800, height: 600}}>
      <NodeEditor
        portTypes={config.portTypes}
        nodeTypes={config.nodeTypes}
      />
    </div>
  );
}

export default App;

and then run npm start which opened the a browser tab and threw the following error:

./src/App.js
Attempted import error: './config' does not contain a default export (imported as 'config').

from flume.

netgfx avatar netgfx commented on June 9, 2024

@chrisjpatty App.js is on the same src folder as config.js this is why the error I'm getting seems to weird to me. Is the npm start the right command? Again this is the default react project that gets automatically created with npx create-react-app my-app.
What else is required to run the basic Flume example?

from flume.

chrisjpatty avatar chrisjpatty commented on June 9, 2024

Can you put your code on a public repository and share the link here? I'm having trouble visualizing how you have your code setup.

from flume.

Related Issues (20)

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.