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

#43 React server-side render #48

Merged
merged 10 commits into from
Dec 19, 2017
Merged

Conversation

Quicksaver
Copy link
Contributor

@Quicksaver Quicksaver commented Dec 15, 2017

Closes #43 - Generates full markup at build time, while retaining any needed JS dynamics on the browser side.

Now using webpack to serve locally

  • employ common NODE_ENV var usage, either "production" or "development";
  • hugo serves the file structure to a temporary directory;
  • those files are then processed by webpack to append the react output;
  • there's a better loading (percentage) indicator in the console when building, so it's easier to know when webpack is done (Cleaner console when serving locally #24);
  • webpack is also the local server used as well, when you run yarn start; used to be hugo doing that, so one more step towards complete hugo abstraction;
  • webpack server doesn't add the trailing slash correctly in the admin path and so Netlify CMS fails to load:

App entry point

  • Renamed the folder jsx to components to be more in-line with common development procedure;
  • The entry point for resulting app.min.js file, called in the browser, is now components/App.jsx, which must be modified to list and initialize every individual component per project/site.

New BesugoComponent properties and methods

(They're all better documented in the code.)

  • .view(), that returns either the window object or CMS's iframe, depending on where it is being rendered, for easier abstraction during any implementation work;
  • .config is an object that defines the component within the website context, see inline comments on what properties it expects;
  • .extraProps() called before building a component, to fetch any information necessary not found in props; use to append directly to props;
  • .buildContainer() what form should the component's container take; by default this returns a simple div. Useful when you're building lists and want to wrap lis in a ul for instance.

@Quicksaver Quicksaver mentioned this pull request Dec 19, 2017
@nunoveloso nunoveloso merged commit 37d86a1 into develop Dec 19, 2017
@nunoveloso nunoveloso deleted the feature/#43_react_render_server branch December 19, 2017 18:04
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.

3 participants