sumul / fractal-react-adapter Goto Github PK
View Code? Open in Web Editor NEWUse React as the template engine for Fractal (http://fractal.build) components.
License: MIT License
Use React as the template engine for Fractal (http://fractal.build) components.
License: MIT License
Hi Sumul,
unfortunately, I cannot get the fractal-react-adapter running. I followed the instructions in your README and I keep getting the following error in the Cart component:
Error: Cannot find module '@button' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (D:/PROJECTS/myProject/fractal-component-library/src/components/05-examples/01-react-components/card.jsx:3:16) at Module._compile (internal/modules/cjs/loader.js:776:30) at loader (D:\PROJECTS\myProject\fractal-component-library\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.(anonymous function) [as .jsx] (D:\PROJECTS\myProject\fractal-component-library\node_modules\babel-register\lib\node.js:154:7) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at ReactAdapter.render (D:\PROJECTS\myProject\fractal-component-library\node_modules\fractal-react-adapter\src\adapter.js:61:23)
Could you please provide any help?
Thanks and kind regards,
Alex
https://github.com/sumul/fractal-react-adapter/blob/master/src/adapter.js#L99
Otherwise it's not possible to specify custom plugins via babelConfig
, eg:
const reactAdapter = require('fractal-react-adapter')({
babelConfig: {
extensions: ['.jsx'],
presets: ['es2015', 'es2017', 'stage-3', 'react'],
plugins: ['transform-class-properties']
}
});
Or use _.merge
on the entire DEFAULT_OPTIONS: https://github.com/sumul/fractal-react-adapter/blob/master/src/adapter.js#L117
The docs for creating preview layouts state that layouts are components and should live in the components directory. If I set components to use a JavaScript extension I cannot create HTML/Handlebars preview layouts
First off, love this. It's almost perfect for what I need, however I noticed the adapter supports ES6 imports just fine, but doesn't seem to support ES6 exports. Any particular reason for this, or am I just missing something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.