Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve start behavior and logging, don't orphan react-scripts, add postcss #34

Merged
merged 5 commits into from
Sep 6, 2019

Conversation

amcgee
Copy link
Member

@amcgee amcgee commented Sep 5, 2019

This has one important functional change - we wait for the app build to succeed before starting the appShell server, so we don't run the risk of orphaning the server process if/when the first compilation fails (a fatal error in rollup). This also:

  • Adds support for overriding the server port with the PORT env var
  • Significantly improves the aesthetic appeal and consistency of console output
  • Stops automatically piping the react-script output

@netlify
Copy link

netlify bot commented Sep 5, 2019

Deploy preview for dhis2-app-platform ready!

Built with commit 5049038

https://deploy-preview-34--dhis2-app-platform.netlify.com

@amcgee
Copy link
Member Author

amcgee commented Sep 5, 2019

Here's an example of what the output looks like when running start and encountering a few errors:
Screenshot 2019-09-05 17 35 01

@varl
Copy link
Contributor

varl commented Sep 5, 2019

The addition of postcss support makes this a feature bump.

I don't have the opportunity to try this tonight but will give it a whirl in the morning. Looks pretty slick!

@amcgee
Copy link
Member Author

amcgee commented Sep 5, 2019

I was thinking about dropping postcss and adding it later, but figured since the compilation failed when it hit a CSS import before it could be considered a fix (doesn't change the API). Either way fine with me, we might want to do CSS imports differently in the future anyways.

The library in question that @erikarenhill was trying to use was @dhis2/analytics - this gets past the CSS import issue but there are other issues we'll need to deal with as well.

Taking out PostCSS for now

@varl
Copy link
Contributor

varl commented Sep 6, 2019

Yeah, avoiding the css-loader situation was one of the reasons we rewrote ui-core from postcss to styled-jsx.

Copy link
Contributor

@varl varl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my machine. 👍

@amcgee
Copy link
Member Author

amcgee commented Sep 6, 2019

Yeah, avoiding the css-loader situation was one of the reasons we rewrote ui-core from postcss to styled-jsx.

Yep, agreed. Libraries with styled-jsx should work, but we'll probably also have to at least temporarily support direct CSS imports (most notably for d2-ui)

I'll open another PR next week to address this and other issues importing some of our legacy libraries

@amcgee amcgee merged commit f9edd31 into master Sep 6, 2019
@amcgee amcgee deleted the fix/better-start-behavior branch September 6, 2019 10:19
dhis2-bot added a commit that referenced this pull request Sep 6, 2019
## [1.2.3](v1.2.2...v1.2.3) (2019-09-06)

### Bug Fixes

* improve start behavior and logging, don't orphan react-scripts, add postcss ([#34](#34)) ([f9edd31](f9edd31))
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