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

Rewire client build and use preact-cli@3.0.0-rc.* #131

Closed
ethanwu10 opened this issue Mar 27, 2020 · 1 comment · Fixed by #133
Closed

Rewire client build and use preact-cli@3.0.0-rc.* #131

ethanwu10 opened this issue Mar 27, 2020 · 1 comment · Fixed by #133
Assignees
Labels
refactoring Improve code quality
Projects

Comments

@ethanwu10
Copy link
Member

ethanwu10 commented Mar 27, 2020

The client build is currently dependent on a shell script, and is running on an older version of preact-cli (the starter projects created by preact-cli all use preact-cli@3.0.0-rc.6, so we should probably also be using the rc versions). Given the refactoring that needs to be done to the webpack configuration to do this upgrade, we should also fix some other issues / annoyances with our client-side build system.

Goals

  • no shell script to build - build everything through preact build (with flags set)
  • use SVG sprite sheets for our SVG loader to avoid duplicating inline SVG - most likely we will use this loader, and an example is included for generating React components automatically (which is what happens with our current config using preact-svg-loader)
  • use preact-cli's builtin API proxying capabilities in dev mode to avoid needing to have the client access the API cross-origin in dev mode
  • fix serving of static files on the server to not require physically moving build outputs on disk (technically a sub-point of removing the shell script)

Upgrading preact-cli (and thus webpack) also will solve our issues with portals crashing on unmount, because this was caused by Webpack resolving the import to the main 'preact' module differently from preact's submodules ('preact/compat'), which are incompatible due to Preact's output setup and mangler in their build.

@ethanwu10 ethanwu10 added the refactoring Improve code quality label Mar 27, 2020
@ethanwu10 ethanwu10 self-assigned this Mar 27, 2020
@ethanwu10 ethanwu10 added this to to-do in Frontend via automation Mar 27, 2020
@ethanwu10
Copy link
Member Author

Did some tests, confirmed updating preact-cli fixes module resolution issues that had caused portals crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Improve code quality
Projects
Frontend
  
done
Development

Successfully merging a pull request may close this issue.

1 participant