1. 06 11月, 2018 1 次提交
    • M
      examples/with-mobx : Fix and simplify (#5537) · 420f74c8
      Már Örlygsson 提交于
      I spent far too much time fiddling with this example project before realizing it contained a bug in the store initialization logic and it was a bit more complex than it needed to be.
      
      * The custom server was not needed
      * The store-initialization did effectively the same thing twice for no reason
      * And wrapping MyApp component in a HOC was wholly unnecessary indirection
      
      My changes are split into four discrete commits for clarity.
      420f74c8
  2. 05 11月, 2018 1 次提交
    • R
      Update next.config.js (#5593) · 14668aa3
      Rafael Cossovan 提交于
      Tests using a case insensitive expression.
      Fixes assets output folder.
      Reduce `limit` so we can use `file-loader` on larger files.
      14668aa3
  3. 03 11月, 2018 2 次提交
  4. 01 11月, 2018 1 次提交
  5. 30 10月, 2018 2 次提交
  6. 29 10月, 2018 1 次提交
  7. 24 10月, 2018 1 次提交
  8. 23 10月, 2018 1 次提交
  9. 21 10月, 2018 3 次提交
  10. 20 10月, 2018 4 次提交
  11. 19 10月, 2018 2 次提交
  12. 18 10月, 2018 1 次提交
  13. 17 10月, 2018 1 次提交
  14. 16 10月, 2018 2 次提交
  15. 15 10月, 2018 1 次提交
  16. 14 10月, 2018 1 次提交
    • D
      mobx-state-tree examples should use _app (#5362) · af9214b3
      Don Alvarez 提交于
      The mobx-state-tree examples (with and without typescript) pre-dated the next _app class and needed to be updated to use _app for persisting state across client-side navigation transitions. Also removed unneeded custom server class to better keep with the "show one feature per example" style of the next examples folder
      af9214b3
  17. 12 10月, 2018 1 次提交
  18. 11 10月, 2018 1 次提交
    • R
      Update with-react-i18next example to use react-i18next@8.0.6 (#5368) · 449dd29d
      Rafael Almeida 提交于
      Fixes #5352 . This updates the example updating react-i18next to v8.0.6, replacing the `translate` HOC to `withNamespaces` and `I18n` to `NamespacesConsumer`.
      
      There is one thing that I am not sure if is correct or not so I need some guidance. You gotta wrap the page with the `withI18next` HOC so it will extend the `getInitialProps` of the page with this:
      
      ```
      Extended.getInitialProps = async (ctx) => {
        const composedInitialProps = ComposedComponent.getInitialProps
          ? await ComposedComponent.getInitialProps(ctx)
          : {}
      
        const i18nInitialProps = ctx.req
          ? i18n.getInitialProps(ctx.req, namespaces)
          : {}
      
        return {
          ...composedInitialProps,
          ...i18nInitialProps
        }
      }
      ```
      
      The problem lies in `i18n.getInitialProps` that has this code:
      
      ```
      i18n.getInitialProps = (req, namespaces) => {
        if (!namespaces) namespaces = i18n.options.defaultNS
        if (typeof namespaces === 'string') namespaces = [namespaces]
      
        req.i18n.toJSON = () => null // do not serialize i18next instance and send to client
      
        const initialI18nStore = {}
        req.i18n.languages.forEach((l) => {
          initialI18nStore[l] = {}
          namespaces.forEach((ns) => {
            initialI18nStore[l][ns] = (req.i18n.services.resourceStore.data[l] || {})[ns] || {}
          })
        })
      
        return {
          i18n: req.i18n, // use the instance on req - fixed language on request (avoid issues in race conditions with lngs of different users)
          initialI18nStore,
          initialLanguage: req.i18n.language
        }
      }
      ```
      
      In my understanding, among other things, it gets the `i18n` object from the request (included by the `server.js`) and uses the data to create `initialI18nStore` and `initialLanguage`, and then return these two objects plus the `i18n` object itself. If you add the `i18n` object on the return, then there will be a crash on the client-side render of the page:
      
      ```TypeError: Cannot read property 'ready' of null```
      
      I don't know why, but returning it breaks `NamespacesConsumer` component from `react-i18next` (the state becomes null). So I commented this line and the provider on `_app.js` is getting the `i18n` instance from the `i18n.js` file (the same as `server.js`). I don't know if this would be an issue so I would like help to debug this.
      449dd29d
  19. 10 10月, 2018 2 次提交
  20. 09 10月, 2018 4 次提交
  21. 07 10月, 2018 2 次提交
  22. 06 10月, 2018 1 次提交
  23. 01 10月, 2018 1 次提交
    • C
      Add analyze bundles example (#5332) · 334b46e8
      Carlos 提交于
      * Add analyze-bundles example
      
      * housekeeping: with-webpack-bundle-analyzer example
      
      * analyze-bundles example: revert the version of faker library
      
      * analyze-bundles add analyze:server and analyze:browser to scripts
      
      * with-webpack-bundle-analyzer example: fix typo
      334b46e8
  24. 29 9月, 2018 1 次提交
  25. 28 9月, 2018 2 次提交