-
Notifications
You must be signed in to change notification settings - Fork 16
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
docs: v12 migration guide [LIBS-689] #884
base: alpha
Are you sure you want to change the base?
Conversation
|
||
- Environment variables on `process.env` will be dropped in future versions, in favor of variables on `import.meta.env` | ||
- The default `direction` config value is `ltr`; in the future, it will be `auto` | ||
- `--allowJsxInJs` will be removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wil this be removed in the underlying Vite CLI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure which bullet point you mean haha, but here's an answer for each:
- Env vars are under our control, but I'm actually rethinking this point, i.e. maybe we should keep variables on
process.env
-- Earlier, I thoughtimport.meta.env
was a pretty standard thing with ES6 and that we should migrate to that for env vars, but I think that's actually just a Vite pattern, so it might be "more standard" to keep env vars onprocess.env
. If we do that, we can at least deprecate theREACT_APP_
prefixes for the variable keys - (Probably obvious, but direction is also under our control)
- For
--allowJsxInJs
, that's also under our control -- it's a flag that our own CLI reads, and adds a bunch of kinda complex Vite config inmakeViteConfig.mjs
. That additional config may or may not be supported in future versions of Vite, but I think we should remove our--allowJsxInJs
flag and config in the nextcli-app-scripts
version to make things simpler, standardized, and more performant
@@ -1,6 +1,8 @@ | |||
- [**Getting Started**](getting-started.md) | |||
- [**Installation**](installation.md) | |||
- [**Bootstrapping**](bootstrapping.md) | |||
- [**Migration**](migration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sidebar isn't used, you need to add it to the sidebar in the developer portal!
So after merging this PR you'd need to merge the developer portal PR as well to get it to show up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, thanks for the reminder!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, amazing guide. It looks very detailed and exhaustive.
I went through the guide with a very nit-picky and oblivious point-of-view, so I added a grand total of 21 comments and suggestions to make it easier to read and contextually make sense.
@@ -0,0 +1,329 @@ | |||
# Platform v12 migration guide: Vite & React 18 | |||
|
|||
Good news! Vite and React 18 in the app platform are ready to use! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line, while good and happy, is very much "timed" as if for a blogpost or the announcement. If someone reads this guide in half a year or later it will be odd. Not sure if it can be omitted fully or reworded.
Paragraph below could use a little rewording as well to match this sentiment.
docs/migration/v12.md
Outdated
|
||
Here are some edge cases that were encountered when upgrading some apps with the new platform version: | ||
|
||
- There is a bug in Vite: importing from a directory, e.g. `‘./app/‘` where we would assume to get `./app/index.[jt]s`, can incorrectly resolve to a file with a similar name to the directory, e.g. `./App.tsx`. I see this as a bug with Vite, but as a workaround, file and dir names can be changed so they don’t conflict. Noticed in the Maintenance app beta. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the Maintenance app example be linked/explained?
docs/migration/v12.md
Outdated
|
||
- There is a bug in Vite: importing from a directory, e.g. `‘./app/‘` where we would assume to get `./app/index.[jt]s`, can incorrectly resolve to a file with a similar name to the directory, e.g. `./App.tsx`. I see this as a bug with Vite, but as a workaround, file and dir names can be changed so they don’t conflict. Noticed in the Maintenance app beta. | ||
- If you’re using `identity-obj-proxy` in your test config, make sure you add it to the project’s dependencies. Previously, some apps got away with using the proxy without an explicitid dependency because the package is a dependency of `react-scripts` | ||
- You may see some build warnings coming from the `mathjs` package. Upgrading to a recent version of `mathjs` will handle these warnings. Noticed in analytics app (the analytics library has a dependency on `mathjs`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the mention of the Analytics app matter? It might confuse more than solve as the solution is a simple upgrade of a package. Maybe add the command to handle this upgrade instead?
docs/migration/v12.md
Outdated
9. An `App.jsx` entrypoint is no longer quietly added if a plugin entrypoint is defined or for a defined but empty entrypoints object | ||
10. Plugins and apps are started together in the same process on the same port | ||
11. Custom `index.html` files are no longer supported | ||
12. `import * as MyClass from ‘my-module’` is now more restrictive, and may break in some cases. So far, changing the import to `import MyClass from ‘my-module’` has fixed it. DOMPurify is one example case, noticed in the Login App |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can Login App example be linked/explained?
Co-authored-by: Rene Pot <[email protected]>
Co-authored-by: Rene Pot <[email protected]>
Co-authored-by: Rene Pot <[email protected]>
LIBS-689