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

Add support for create-react-app@3.0.0 #6560

Merged
merged 1 commit into from Apr 23, 2019
Merged

Conversation

mrmckeb
Copy link
Member

@mrmckeb mrmckeb commented Apr 18, 2019

Issue: facebook/create-react-app#6656

What I did

create-react-app@3 is likely to be released next week, and adds support for baseUrl in tsconfig.json and jsconfig.json files. Users will be told that NODE_PATH is deprecated, although it'll still work for now.

We want to make sure that users that do remove NODE_PATH don't find that their Storybook no longer works as expected.

How to test

  • Is this testable with Jest or Chromatic screenshots? No
  • Does this need a new example in the kitchen sink apps? No
  • Does this need an update to the documentation? No

This can be tested by installing alongside the latest next release with the --typescript flag.
https://www.npmjs.com/package/create-react-app/v/3.0.0-next.68

After installation, add the property baseUrl with the value src to the project's tsconfig.json.

@mrmckeb mrmckeb added react cra Prioritize create-react-app compatibility labels Apr 18, 2019
@mrmckeb mrmckeb self-assigned this Apr 18, 2019
@vercel
Copy link

vercel bot commented Apr 18, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-feature-support-cra-baseurl.storybook.now.sh

@ndelangen
Copy link
Member

Wow amazing @mrmckeb

@codecov
Copy link

codecov bot commented Apr 18, 2019

Codecov Report

Merging #6560 into next will increase coverage by 0.13%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #6560      +/-   ##
==========================================
+ Coverage   40.69%   40.82%   +0.13%     
==========================================
  Files         616      616              
  Lines        8534     8541       +7     
  Branches      600      595       -5     
==========================================
+ Hits         3473     3487      +14     
+ Misses       4972     4962      -10     
- Partials       89       92       +3
Impacted Files Coverage Δ
app/react/src/server/cra-config.js 85.52% <76.92%> (-1.98%) ⬇️
lib/ui/src/components/layout/desktop.js 100% <0%> (ø) ⬆️
...-native/src/preview/components/StoryView/index.tsx 0% <0%> (ø) ⬆️
addons/storysource/src/manager.js 0% <0%> (ø) ⬆️
lib/api/src/modules/layout.ts 46.47% <0%> (+9.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f93649...c122019. Read the comment docs.

@mrmckeb mrmckeb marked this pull request as ready for review April 19, 2019 06:43
@mrmckeb
Copy link
Member Author

mrmckeb commented Apr 19, 2019

This is ready for review @ndelangen, I'd just like to hold off merging until I can test with the final release.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for taking care of this 🎖

@shilman shilman merged commit a5e9b2e into next Apr 23, 2019
@shilman shilman deleted the feature/support-cra-baseurl branch April 23, 2019 06:58
@pavinthan
Copy link

but this changes is not working for latest CRA app:
This is my jsconfig.json

{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}

This is my component

...
import { name } from "config/env";
...

I got this error when I start storybook

ERROR in ./src/components/DocumentHead/index.js
Module not found: Error: Can't resolve 'config/env' in '/Users/pavinthan/code/projects/deliver-daily/kpi-client/src/components/DocumentHead'

@mrmckeb
Copy link
Member Author

mrmckeb commented Apr 26, 2019

@pavinthan, can you share a reproduction of this issue? I can take a look for you :)

@Hypnosphi
Copy link
Member

@pavinthan it should be fixed with #9324

@pavinthan
Copy link

@mrmckeb I'm really very sorry becase I did not check this, I just skiped and thanks for your actions guys 🙏 🙏 🙏

// cc @Hypnosphi

@mrmckeb
Copy link
Member Author

mrmckeb commented Jan 6, 2020

No problem, thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cra Prioritize create-react-app compatibility feature request react
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants