Skip to content

Conversation

mischnic
Copy link
Collaborator

@mischnic mischnic commented Aug 5, 2018

Currently fixing a problem with window reloading in: kusti8/proton-native#180


Is npm run dev fine as the hot-reloading command?


  • Added hot reloading to readme and fixed typos.
  • Added all commands to the cli output:
Great! You are all set.
Created test-app inside /.../test-app


Inside that directory, you can run the following commands:

 npm run start
 Will run your application.

 npm run dev
 Will run your application with hot-reloading.

 npm run build
 Transpiles and bundles your source files.

 npm run dist
 Creates an archive containing the bundle.

Go to your project folder and run your application by typing:
 cd test-app
 npm run start

@albe-rosado
Copy link
Owner

albe-rosado commented Aug 5, 2018

Got this behavior when testing it.
Every time a change is saved, another instance of the windows is loaded.
@mischnic
example

@mischnic
Copy link
Collaborator Author

mischnic commented Aug 5, 2018

Doesn't happen for me (Win 10).

What happens if you change the Example.val prop in index.js?
What happens if you change the window title or some of the text in app.js?

index.js:

import React, { Component } from "react";
import { App, Window, render, Box } from "proton-native";
import { Example } from "./app.js";

class HotApp extends Component {
	render() {
		return (
			<App>
				<Example val="sf123sdfd"/>
			</App>
		);
	}
}

render(<HotApp />);

app.js

import React, { Component, PureComponent } from "react";
import { Box, TextInput, Text, Window } from "proton-native";

class Example extends PureComponent {
	render() {
		return (
			<Window title="Notedssds" size={{ w: 500, h: 350 }} margined>
			<Box padded>
				<TextInput />
				<Text>asddd</Text>
				<Text>{this.props.val}</Text>
			</Box>
			</Window>
		);
	}
}

export { Example };

@albe-rosado
Copy link
Owner

Will tell you as soon as I get home! Thanks @mischnic !!!

@albe-rosado
Copy link
Owner

your example works as expected. The generated placeholder doesn't. Another thing, when running npm run dev, and closing the window, the process does not exit , not clear if that is expected behavior. @mischnic

@mischnic
Copy link
Collaborator Author

mischnic commented Aug 7, 2018

and closing the window, the process does not exit , not clear if that is expected behavior.

Haven't noticed that before.


your example works as expected. The generated placeholder doesn't.

Could you please be more specific? For me:

What happens if you change the Example.val prop in index.js?

The window closes and a new one opens (with the changes).

What happens if you change the window title or some of the text in app.js?

Everything updates correctly in the current window.

@albe-rosado
Copy link
Owner

albe-rosado commented Aug 10, 2018

@mischnic What I meant was, the example you provided, works, ie. windows don't dont replicate for every state change, and the changes are reflected, but the initial boilerplate code, that is generated when you use create-proton-app, does replicate the windows when you save a change (as the picture shows).

@albe-rosado
Copy link
Owner

albe-rosado commented Oct 13, 2018

hey, @mischnic send me an email to (the one in my bio), I wanna discuss something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants