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

[RFC] Some improvements and breaking changes #36

Closed
7 tasks done
stereobooster opened this issue Nov 14, 2017 · 3 comments
Closed
7 tasks done

[RFC] Some improvements and breaking changes #36

stereobooster opened this issue Nov 14, 2017 · 3 comments

Comments

@stereobooster
Copy link
Owner

stereobooster commented Nov 14, 2017

path/index.html vs path.html

  • done/not done

From the ticket #22. I do not see any sense to generate path.html for /path route instead of path/index.html. This convention was copied from react-snapshot.
After the change react-snap will generate path/index.html for both: /path and /path/

Preload resources

  • done/not done

As of now, this config does two things:

  • stores JSON in window.snapStore[<path>]
  • create preload instructions for images (<link rel="preload" as="image">)

Need to fix two things:

webpack 2+ code splitting hack

  • done/not done

There is a hack to make webpack code splitting work. Because we assume usage with c-r-a it should be enabled by default. But before enabling it by default need to fix it - use <link rel="preload" instead of script tags

404 page

  • auto 404
  • warnings for 404

As of now react-snap by default generates 404 page, which I consider a good practice, but it actually doesn't make sense to generate 404 if you do not use routing (like react-route or similar), I mean if you have only one page.

So I consider changing this behavior and generate 404 page if there is more than one page discovered by the crawler or listed in include.

Another thing that I was wondering is how to detect that 404.html is actually a "not found page". How to make sure programmer didn't forget to handle this case?
The only option I came up is: check if the title of the page contains the string "404". It can be in any position. Also, the nice benefit is that it will possible to track that no other page is "404".

Proper exit status for errors

  • done/not done
  • support errors in minimalcss moved to separate ticket

Check if target directory contains 200.html, and if it does fail with an error message and non-zero exit code.

Also, exit with non-zero exit code if any error occurred during generation and stop generation. As of now react-snap reports error in console, but continues to generate pages.

@ryan-ds17
Copy link

In the noscript issue, I tried for react and it does add the styles to noscript. Should I create a PR?

@stereobooster
Copy link
Owner Author

@ryan-ds17 yes totally

@stereobooster
Copy link
Owner Author

stereobooster commented Nov 18, 2017

Last call before I release this beast. Closing issue there is a PR

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

No branches or pull requests

2 participants