infernojs / create-inferno-app Goto Github PK
View Code? Open in Web Editor NEWThis project forked from facebook/create-react-app
Create Inferno apps with no build configuration.
License: MIT License
This project forked from facebook/create-react-app
Create Inferno apps with no build configuration.
License: MIT License
After running npm run eject
the user has the following message displayed:
Please consider sharing why you ejected in this survey:
http://goo.gl/forms/Bi6CZjk1EqsdelXk1
This leads to Facebook's create-react-app
survey, not Inferno's create-inferno-app
survey. Perhaps we should remove or create our own survey?
For reference, the line that would need to be changed is here:
https://github.com/infernojs/create-inferno-app/blob/master/packages/inferno-scripts/scripts/eject.js#L159
I receive the following error message when using create-inferno-app after install new Node version:
yarn add v1.6.0
(node:29860) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
I haven't had a chance to figure out which package is depending on upath version 1.0.4 and causing this error.
Edit: This is not isolated to create-inferno-app, same issue exists with create-react-app (not suprising)
This passage in the readme file has me a bit confused:
Usage with Inferno (through inferno-compat)
You can use Inferno components with
create-inferno-app
. All you have is to do is installinferno-compat
(npm install --save inferno-compat
) and Inferno and InfernoDOM will be already aliased to inferno-compat. After installing it you can import any Inferno dependent library or use any code that imports Inferno and that should work fine.
Why wouldn't create-inferno-app
work with Inferno out of the box, and isn't inferno-compat
meant for React?
Is this the result of an overzealous find/replace or am I missing something?
Hello !
I test Inferno and create-inferno-app on github pages
https://corbane.github.io/Mainstenant/
But the paths begin at the root of github...
Did I forget something?
thank you!
Hi, i tried creating an inferno app using this tool but it's generating a broken app.
Environment:
Steps:
npx create-inferno-app test
cd test
npm start
Expected behavior: localhost:3000
should load a working inferno-based app
Actual behavior: the local server starts fine, but delivers an app which renders nothing and crashes with the following error:
Uncaught TypeError: Cannot read property 'close' of undefined
at Object.<anonymous> (index.js:72)
at Object../node_modules/inferno-dev-utils/node_modules/chalk/index.js (index.js:228)
...
Here's a screenshot of the error: https://www.screencast.com/t/ghJsLdwMr8UG
Please advise :)
Thank you for your time!
The scripts are working great but how to do server side rendering with them?
I'm using firebase
Thanks in advance
Hi!
I did a fresh app through the CLI and the command npm test (or yarn test) do not work.
I am getting the following error message:
Determining test suites to run...Error: This promise must be present when running with -o. at my-project/node_modules/jest-cli/build/search_source.js:202:17 at Generator.next (<anonymous>) at step (my-project/node_modules/jest-cli/build/search_source.js:19:362) at my-project/node_modules/jest-cli/build/search_source.js:19:592 at new Promise (<anonymous>) at my-project/node_modules/jest-cli/build/search_source.js:19:273 at SearchSource.getTestPaths (my-project/node_modules/jest-cli/build/search_source.js:216:10) at my-project/node_modules/jest-cli/build/run_jest.js:44:29 at Generator.next (<anonymous>) at step (my-project/node_modules/jest-cli/build/run_jest.js:23:380)
Following the installation steps in the README, I create a new project create-inferno-app
, then I run it npm start
and I get this error:
module.js:471
throw err;
^
Error: Cannot find module 'react-dev-utils/clearConsole'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\paadams\meow\node_modules\inferno-scripts\scripts \start.js:26:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\paadams\\AppData\\Roaming \\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `inferno-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'inferno-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the meow package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! inferno-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs meow
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls meow
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\paadams\meow\npm-debug.log`
Hey - just a question : considering that inferno-devtools
is needed to benefit from React chrome extension, wouldn't it make sense to ship it with create-inferno-app
and requiring it when process.env.NODE_ENV
is set to development
?
Yes, npm -v: 4.0.5
Yarn gets stuck on Installing Inferno-scripts. Currently stuck on: esprima@~3.0.0
Yarn should install the Inferno-scripts
Yarn gets stuck on esprima@~3.0.0
npm ls inferno-scripts
(if you haven’t ejected): `-- (empty)node -v
: 7.4.0npm -v
: 4.0.5yarn version
: 0.18.1Then, specify:
within react, when including an svg "symbol", I've used "xlinkHref" translated to "xlink:href" after transpiling.
this doesn't work within Inferno;
I've found a working solution for the latest Firefox : using simply href, however this doesn't work with other browser, for example Safari Tech Prev.
Is there anyway to use straight "xlink:href" without this error :
Failed to compile.
Error in ./src/ItemView.js
Module build failed: TypeError: name.toLowerCase is not a function
at Array.forEach (native)
Yes. My environment versions:
→ node --version
v7.1.0
→ npm --version
3.10.9
→ yarn --version
0.16.1
→ create-inferno-app version
1.1.2
Saw these errors while creating an app
warning inferno-scripts > jest > jest-cli > istanbul-api > fileset > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning Incorrect peer dependency "[email protected]".
warning Incorrect peer dependency "[email protected]".
warning Incorrect peer dependency "[email protected]".
warning Incorrect peer dependency "[email protected]".
warning Incorrect peer dependency "[email protected]".
warning Incorrect peer dependency "[email protected]".
What are you reporting?
On freshly created inferno-app, hot reloading for CSS and JS is not working.
Note: create-react-app works correctly for me.
Page should reload with the latest changes.
Browser does not refresh automatically.
Run these commands in the project folder and fill in their results:
npm ls inferno-scripts
(if you haven’t ejected):node -v
:npm -v
:→ npm ls inferno-scripts
[email protected] /Users/abhishek/devel/oss/nextgen
└─┬ [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── UNMET PEER DEPENDENCY [email protected]
└── UNMET PEER DEPENDENCY [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
Then, specify:
Max OS Sierra version 10.12.1
Google chrome - Version 57.0.2962.0 canary (64-bit)
Sorry it's just my local experiment project.
After a fresh install of create-inferno-app
: the create command fails with the error:
env: node\r: No such file or directory
$ yarn global add create-inferno-app
yarn global v0.21.3
warning No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Installed "[email protected]" with binaries:
- create-inferno-app
warning No license field
✨ Done in 0.71s.
$ create-inferno-app
env: node\r: No such file or directory
$ create-inferno-app try-create-inferno-app
env: node\r: No such file or directory
$ node -v
v7.8.0
$ npm -v
4.2.0
Version: 2.0.0
Platform: Win 8 - Node 7.7.4
npm start
Compiled with warnings.
Warning in ./src/logo.js
C:\Users\MOCR\my-app\src\logo.js
1:8 warning 'inferno' is defined but never used no-unused-vars
✖ 1 problem (0 errors, 1 warning)
@ ./src/App.js 11:0-26
@ ./src/index.js
@ multi .//inferno-dev-utils/webpackHotDevClient.js .//inferno-scripts/config/polyfills.js ./~/inferno-dev-utils/crashOverlay.js ./src/index.js
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
" Welcome to Inferno 1.5.3
To get started, edit src/App.js and save to reload. "
Missing SVG Logo.
Are class values correct?
Outer HTML
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<!--
Notice the use of in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Inferno App</title>
<style type="text/css">.App {
text-align: center;
}
.App-logo {
height: 80px;
}
.App-header {
background-color: #f8f8f8;
height: 150px;
padding: 20px;
color: #3d464d;
}
.App-intro {
font-size: large;
}
code {
color: #e73a37;
}</style><style type="text/css">body {
margin: 0;
padding: 0;
font-family: "Open Sans", "lucida grande", "Segoe UI", arial, verdana, "lucida sans unicode", tahoma, sans-serif;
}
</style></head>
<body>
<div id="app"><div class="[object Object]"><div class="[object Object]"><svg class="[object Object]"><g class="[object Object]"><path class="[object Object]"></path><path class="[object Object]"></path></g></svg><h2>Welcome to Inferno 1.5.3</h2></div><p class="[object Object]">To get started, edit <code>src/App.js</code> and save to reloading.</p></div></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
<script type="text/javascript" src="/static/js/bundle.js"></script>
</body></html>
\```
After installing and running clean following the instructions given, the Inferno app crashes with the following message:
Unhandled Rejection (Error): Unknown event
promiseHandler
./~/inferno-dev-utils/crashOverlay.js:861
I'm not certain whether this should be in here, inferno-scripts, or inferno itself, so happy to remove it if it should be somewhere else!
The scripts only work on linux after i do a dos2unix on them.
Fedora 25
npm 3.10.10
node v6.10.0
Latest create-react-app releases now build a PWA by default. I wonder if you could port this feature to create-inferno-app.
Linking to infernojs/inferno#1174
Observed Behaviour
When testing components that reference react
-based components (like react-bootstrap
ones), Jest reports Cannot find module 'react' from <whatever>
. It looks like inferno-compat
is not taken into account when testing.
Additionally, trying to patch Jest configuration in package.json
like described for Preact (preactjs/preact#560) yields the following error:
Therefore, I'd say it is not possible to test any react-based component today, unless ejecting from the standard config - which is, IMHO, quite disappointing for such a common scenario.
Expected Current Behaviour
Inferno-compat should support testing as well.
Inferno Metadata
Windows 10 v1703
[email protected]
[email protected]
[email protected]
my .env
file
HOST = pwa.w88.local
PUBLIC_URL = /pwa
SESSION_POLLING_TIMEOUT = 30
my src/index.js
file
console.log(process.env);
I only see
{NODE_ENV: "development", PUBLIC_URL: ""}
I should see
my defined variable, SESSION_POLLING_TIMEOUT
and PUBLIC_URL
available there.
is it possible to give a --host sub.domain.local to inferno-scripts start so that it starts in http://sub.domain.local:3000 instead of http://localhost:3000?
As mentioned in this related issue (infernojs/inferno#973), upgrading to [email protected]
(which happens automatically, since the outputted package.json
refers to "inferno": "^x.y.z"
) produces the aforementioned error.
Solution should be updating babel-plugin-inferno
to v3.1.0, as pointed out by @kirill-kruchkov
Enzyme didn't work without react
, react-dom
and react-addons-test-utils
! I thought inferno-test-utils
will do the trick but it didn't
can you guys suggest anything? because I think using react and react-dom is an overkill !!
I've updated the version of Inferno to use (@beta34
). Would you mind checking it over and doing a release if looks okay to you?
Creating an app fails:
$ create-inferno-app my-app
...
npm ERR! argv "/Users/mirko/.nvm/versions/node/v7.2.1/bin/node" "/Users/mirko/.nvm/versions/node/v7.2.1/bin/npm" "install" "--save-dev" "--save-exact" "inferno-scripts"
npm ERR! Path must be a string. Received undefined
Same happens trying to install inferno-scripts
manually:
my-app$ npm install --save inferno-scripts
npm ERR! argv "/Users/mirko/.nvm/versions/node/v7.2.1/bin/node" "/Users/mirko/.nvm/versions/node/v7.2.1/bin/npm" "install" "--save" "inferno-scripts"
npm ERR! Path must be a string. Received undefined
Latest available inferno-scripts version:
$ npm view inferno-scripts version
0.7.10
System Version: macOS 10.12.1
$ node -v
v7.2.1
$ npm -v
4.0.3
The jsx-a11y's img-has-alt
rule has been modified to alt-text
in version 5.0.0.
eslint-plugin-inferno
provides better eslint rules than the default configuration. In particular, eslint gives the following warning with every component: 'Inferno' is defined but never used (no-unused-vars)
There are two solutions:
Use .eslintrc configuration from the project root, if present. Currently, custom .eslintrc files are ignored. Allow developers to customize eslint using their own configuration.
Add eslint-plugin-inferno
as a project dependency and configure eslint to use it automatically. This would change the default rules for everyone without giving an option to modify them.
Hi,
After npm run build
and firebase deploy
i can still read the source (full variable names) in dev tools.
I need to install some extra webpack plugin?
Thanks
Greetings
The Table Of Contents has an entry for "Adding Bootstrap". When you click it, nothing happens. It appears that the anchor for that entry is simply missing. If you click the sub-entry "Using A Custom Thing" you arrive at a section with that title; above it is some text relating to "Inferno Bootstrap" but it appears inside the section "Global Variables".
So it appears that the anchor and some of the text relating to "Inferno Bootstrap" may have gotten accidentally deleted in an edit of the page.
In development everything works correct. But when i deployed my app into github pages. I get error cause this.props.children
is empty. See Open dev console output. What i am doing wrong?
Root.js
const routes = (
<Router history={browserHistory}>
<Route component={App}>
<IndexRoute component={Home}/>
<Route path="/about" component={About}/>
</Route>
</Router>
)
App.js
<div className="App-intro">
{ console.log(this.props, this.props.children)}
{ Inferno.cloneVNode(this.props.children, {diffMode: this.state.activateDiffMode}) }
</div>
Hi!
I've noticed that User Guide's links on README.md are pointing do facebookincubator
. I don't know if somebody has already noticed that, but I can obviously do it in a PR if you guys want.
Good job with inferno :)
I have an issue using flowtype, it seems it does not get compiled at all.
When you generate an app, there is an animated React logo, we should probably replace this with an Inferno logo and also add an Inferno favicon.
How about adding this option to the webpack config?
I'm currently ejecting just for this.
It'd be done the same way CRA treats react-native-web.
It's alised but not installed, then the user would have to install inferno-compat to use it but not worry about aliasing.
Inferno-compat is awesome and it makes styled-components, recompose, react-list, rheostat, react-share, react-sizeme work nicely for me.
Seems like a bug on the eject comment annotations:
@remove-on-eject-begin
and @remove-on-eject-end
being misplaced on the config/wepack.config.dev.js
and config/wepack.config.prod.js
blueprints.
PR To come
Hey, folks! It's my first time trying Inferno and it seems really promising. Thank you for that! 😄
I've installed create-inferno-app but I couldn't npm start it because it depends on yarn (?). I haven't found this requirement anywhere in the main readme though. It is working as expected as I installed Yarn, so it's just a heads up. 😄
Hey - I'm really interested in this, congrats! I've seen that create-react-app is now using webpack 2.0, any plans of doing the same? Just curious, it's not vital considering one of the main objectives of this bootstrap is to not care about webpack configuration...
I'm probably just missing something, but I just tried running a new app created with create-inferno-app
in IE11 and I'm getting a syntax error. It looks like it’s because of the arrow function in inferno-dev-utils/node_modules/ansi-regex/index.js
:
module.exports = () => {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, 'g');
};
Do I need to add a polyfill or something to get this to work in IE11?
When ejecting, the URL that appears is the one to create-react-app.
The URL is: http://goo.gl/forms/Bi6CZjk1EqsdelXk1
Watcher does not trigger recompile on sub-level .css
changes.
src
|- index.js
|- index.css
|- App.css
|- App.js
\components
| - Sidebar.js
| - Sidebar.css
Saving src/components/Sidebar.css
should trigger the same behaviors as saving src/App.css
.
Easy fix. I just don't have time to right now.
The documentation for environment variables mentions that you need to prepend variable names with REACT_APP_
, but it looks like the actual prefix is INFERNO_APP_
. The incorrect prefix is mentioned several times in the doc.
I switched my App to the new version with Inferno 1.4 and Webpack2., but the request to the API are not proxied anymore in development. I have found the corresponding issue in one of the dependant packages: chimurai/http-proxy-middleware#143
As suggested there, if I change config/webpackDevServer.config.js and add this line
https: protocol === 'https' ? {
spdy: {
protocols: ['http/1.1'],
},
} : false,
it works again. Can we add this line or make adjustments in scripts/addWebpackMiddleware.js ?
You demonstrate usage using the npx
binary.
I assume you mean npx which I had never heard about before. Ah, I see a link on the Readme to this blog post but had to really look for it...
Please provide better usage instructions, including using the create-inferno-app
binary directly without npx
. Thanks :)
using yarn test or npm test after fresh install gives this error
--watch is not supported without git/hg, please use --watchAll
test can be started if I initialize repository or using --watchAll which is not needed in create-react-app
I realized that yarn run eject
throws the following error in the console:
(node:21537) UnhandledPromiseRejectionWarning:
Unhandled promise rejection (rejection id: 1):
Error: ENOENT: no such file or directory, open
'/Users/david/repos/test-inferno/node_modules/inferno-scripts/.babelrc'
(node:21537) DeprecationWarning: Unhandled promise rejections are deprecated.
In the future, promise rejections that are not handled will terminate the Node.js process
with a non-zero exit code
I've found the https://github.com/infernojs/inferno-typescript-example project, but it would be really nice to add typescript and tsx support to this build system. It could be a command line parameter, that makes a typescript project instead, or simply support .ts files and transpile them when necessary.
I tried to run any of the scripts:
start
, eject
and it was telling me that inquirer.prompt was not a function. Then I dig a bit deeper and I found that we were requiring from the wrong module location:
var inquirer = require('./inquirer');
instead of
var inquirer = require('inquirer');
I tried again yarn start
and all worked again...
I have a React app which I have bootstrapped with
create-react-app --scripts-version=react-scripts-ts
and would like to see how well it performs with Inferno. (Which means: I am using Typescript but have no webpack config because it is already provided by the Typescript version of react-scripts).
Is there a simple way to do that migration?
When reading the guide I found links to the CHANGELOG file are broken. There's a 404 page instead.
If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.
Yes, I'm running [email protected]
and I've ran this: (im on OSX)
npm install -g npm@latest
cd your_project_directory
rm -rf node_modules
npm install
Yes
in-browser runtime errors related to jsx not being compiled via babel:
5.2f3d2e1….chunk.js:1 Uncaught SyntaxError: Unexpected token <
main.fa8c7ab….js:1 Dynamic page loading failed Error: Loading chunk 5 failed.
at HTMLScriptElement.n (main.fa8c7ab….js:1)
i @ main.fa8c7ab….js:1
1.fea1997….chunk.js:1 Uncaught SyntaxError: Unexpected token <
0.c1522f9….chunk.js:1 Uncaught SyntaxError: Unexpected token <
main.fa8c7ab….js:1 Uncaught (in promise) Error: Loading chunk 5 failed.
at HTMLScriptElement.n (main.fa8c7ab….js:1)
n @ main.fa8c7ab….js:1
sw.js:1 The script has an unsupported MIME type ('text/html').
http://localhost:3000/sw.js Failed to load resource: net::ERR_INSECURE_RESPONSE
App should run.
Blank page with errors in console
Run these commands in the project folder and fill in their results:
npm ls inferno-scripts
(if you haven’t ejected):$ npm ls inferno-scripts
[email protected] /Users/<home>/dev/repos/inferno-test-2
└── [email protected]
node -v
: v7.3.0npm -v
: 4.0.5Then, specify:
OSX macOS Sierra v10.12.2
Chrome v55.0.2883.95
Following #31 (comment), shouldn't this repo track v0.9.x of create-react-app instead of the master?
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.