-
-
Notifications
You must be signed in to change notification settings - Fork 761
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
feat: Public dir support #569
Merged
isaachinman
merged 16 commits into
i18next:master
from
nathanfriemel:public-dir-support
Dec 24, 2019
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0d32850
upped next version to 9.1
nathanfriemel 30857d5
ts error fix
nathanfriemel ce49675
Merge branch 'master' into public-dir-support
nathanfriemel e15767c
removed function return types
nathanfriemel 7654b43
Merge branch 'public-dir-support' of github.com:nathanfriemel/next-i1…
nathanfriemel 5672a4d
missed a couple return types
nathanfriemel 3d1f4fa
using built in logging, default localePath changed to public/static/l…
nathanfriemel 9b24341
Merge branch 'master' into public-dir-support
nathanfriemel ce0bfd6
fixing code climate errors
nathanfriemel ae482ce
adding slash to header
nathanfriemel 91864e8
updated test helper localePath and related tests to include public st…
nathanfriemel 38e560a
yarn.lock was out of sync with upstream, updating tests
nathanfriemel 6173981
merge master
nathanfriemel ccdc898
changing static to public/static
nathanfriemel 9fd18f7
Merge branch 'master' into public-dir-support
nathanfriemel 229365f
checking defaultns always and only throwing if non production
nathanfriemel File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#__next { | ||
font-family: 'Open Sans', sans-serif; | ||
text-align: center; | ||
background-image: linear-gradient(to left top, #ffffff, #f5f5f5, #eaeaea, #e0e0e0, #d6d6d6); | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
min-width: 100vw; | ||
} | ||
|
||
h1, | ||
h2 { | ||
font-family: 'Oswald', sans-serif; | ||
} | ||
|
||
h1 { | ||
font-size: 3rem; | ||
margin: 5rem 0; | ||
} | ||
h2 { | ||
min-width: 18rem; | ||
font-size: 2rem; | ||
opacity: 0.3; | ||
} | ||
|
||
p { | ||
line-height: 1.65em; | ||
} | ||
p:nth-child(2) { | ||
font-style: italic; | ||
opacity: 0.65; | ||
margin-top: 1rem; | ||
} | ||
|
||
a.github { | ||
position: fixed; | ||
top: 0.5rem; | ||
right: 0.75rem; | ||
font-size: 4rem; | ||
color: #888; | ||
opacity: 0.8; | ||
} | ||
a.github:hover { | ||
opacity: 1; | ||
} | ||
|
||
button { | ||
display: inline-block; | ||
vertical-align: bottom; | ||
outline: 0; | ||
text-decoration: none; | ||
cursor: pointer; | ||
padding: .4rem; | ||
background-color: rgba(255, 255, 255, 0.5); | ||
box-sizing: border-box; | ||
font-size: 1em; | ||
font-family: inherit; | ||
border-radius: 3px; | ||
margin: .1rem; | ||
transition: box-shadow .2s ease; | ||
user-select: none; | ||
line-height: 2.5em; | ||
min-height: 40px; | ||
padding: 0 .8em; | ||
border: 0; | ||
color: inherit; | ||
position: relative; | ||
transform: translateZ(0); | ||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .26); | ||
margin: 0.8rem; | ||
} | ||
|
||
button:hover, | ||
button:focus { | ||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, .4); | ||
} | ||
|
||
main { | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
footer { | ||
background-color: rgba(255, 255, 255, 0.5); | ||
width: 100vw; | ||
padding: 3rem 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"h1": "Ein einfaches Beispiel", | ||
"change-locale": "Wechseln Locale", | ||
"to-second-page": "Zur zweiten Seite", | ||
"error-with-status": "Auf dem Server ist ein Fehler ({{statusCode}}) aufgetreten", | ||
"error-without-status": "Auf dem Server ist ein Fehler aufgetreten" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"description": "Dies ist eine Nicht-Seitenkomponente, die einen eigenen Namespace erfordert" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"h1": "Eine zweite Seite, um das Routing zu demonstrieren", | ||
"back-to-home": "Zurück zur Hauptseite" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"h1": "A simple example", | ||
"change-locale": "Change locale", | ||
"to-second-page": "To second page", | ||
"error-with-status": "A {{statusCode}} error occurred on server", | ||
"error-without-status": "An error occurred on the server" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"description": "This is a non-page component that requires its own namespace" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"h1": "A second page, to demonstrate routing", | ||
"back-to-home": "Back to home" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am just now realising that this fallback will only take place in non-production modes. Wouldn't that effectively break all currently-deployed apps where people rely on the default value of
localePath
being thestatic
dir?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.
Yeah you're right, will look at this again in the morning.
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.
Sorry for the break, holidays and work and what not. What was the original reason for the
process.env.NODE_ENV !== 'production'
here? Was it to prevent the error throw in production? I looked at the ticket in the comment and the PR for it and just want to figure out the original intent before changing anything more.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.
No problem. Yes that's correct - this
if
block is/was solely for non-production validation of the default namespace.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.
Moved the production check to just before the error throw, hopefully that sorts things.