Skip to content

Commit 7c725d8

Browse files
authored
chore: internal renaming to __cedarjs__ (#1390)
1 parent b859a70 commit 7c725d8

File tree

19 files changed

+76
-76
lines changed

19 files changed

+76
-76
lines changed

packages/router/src/rsc/RscCache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ if (typeof globalThis.WebSocket === 'undefined') {
1111
}
1212

1313
export interface RscModel {
14-
__rwjs__Routes: [React.ReactElement]
15-
__rwjs__rsa_data?: unknown
14+
__cedarjs__Routes: [React.ReactElement]
15+
__cedarjs__rsa_data?: unknown
1616
}
1717

1818
/**

packages/router/src/rsc/RscRoutes.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ async function rsaFetch(
5656
}
5757

5858
function rscFetch(serializedLocation: string) {
59-
const rscId = '__rwjs__Routes'
59+
const rscId = '__cedarjs__Routes'
6060

6161
return fetch(BASE_PATH + rscId + '?' + serializedLocation, {
6262
headers: { 'rw-rsc': '1' },
6363
})
6464
}
6565

6666
type SerializedLocation =
67-
| `__rwjs__pathname=${string}&__rwjs__search=${string}`
68-
| `__rwjs__pathname=${string}&__rwjs__search=${string}::${string}`
67+
| `__cedarjs__pathname=${string}&__cedarjs__search=${string}`
68+
| `__cedarjs__pathname=${string}&__cedarjs__search=${string}::${string}`
6969

7070
function rscFetchRoutes(serializedLocation: SerializedLocation) {
7171
console.log(
@@ -114,7 +114,7 @@ function rscFetchRoutes(serializedLocation: SerializedLocation) {
114114

115115
const model = await modelPromise
116116

117-
return model.__rwjs__rsa_data
117+
return model.__cedarjs__rsa_data
118118
},
119119
}
120120

@@ -133,7 +133,7 @@ interface Props {
133133
}
134134

135135
export const RscRoutes = ({ pathname, search }: Props) => {
136-
const serializedLocation: SerializedLocation = `__rwjs__pathname=${pathname}&__rwjs__search=${search}`
136+
const serializedLocation: SerializedLocation = `__cedarjs__pathname=${pathname}&__cedarjs__search=${search}`
137137
const [currentRscCacheKey, setCurrentRscCacheKey] = useState(() => {
138138
console.log('RscRoutes :: useState initial value')
139139
// Calling rscFetchRoutes here to prime the cache
@@ -165,5 +165,5 @@ export const RscRoutes = ({ pathname, search }: Props) => {
165165
throw new Error('Missing RSC cache entry for ' + currentRscCacheKey)
166166
}
167167

168-
return use(rscModelPromise).__rwjs__Routes[0]
168+
return use(rscModelPromise).__cedarjs__Routes[0]
169169
}

packages/router/src/rsc/clientSsr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async function getEntries() {
1111
if (globalThis.__cedarjs__vite_ssr_runtime) {
1212
return {
1313
serverEntries: {
14-
__rwjs__Routes: '../../src/Routes.tsx',
14+
__cedarjs__Routes: '../../src/Routes.tsx',
1515
},
1616
ssrEntries: {},
1717
}
@@ -36,7 +36,7 @@ async function getRoutesComponent(): Promise<React.FunctionComponent> {
3636
const { serverEntries } = await getEntries()
3737
const entryPath = path.join(
3838
getPaths().web.distRsc,
39-
serverEntries['__rwjs__Routes'],
39+
serverEntries['__cedarjs__Routes'],
4040
)
4141
console.log('getRoutesComponent entryPath', entryPath)
4242
const routesModule = await import(makeFilePath(entryPath))

packages/router/src/rsc/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function importReact() {
2626
}
2727

2828
const distSsr = getPaths().web.distSsr
29-
const reactPath = makeFilePath(path.join(distSsr, '__rwjs__react.mjs'))
29+
const reactPath = makeFilePath(path.join(distSsr, '__cedarjs__react.mjs'))
3030

3131
return (await import(reactPath)).default
3232
}
@@ -45,7 +45,7 @@ export async function importRsdwClient(): Promise<RSDWClientType> {
4545

4646
const distSsr = getPaths().web.distSsr
4747
const rsdwClientPath = makeFilePath(
48-
path.join(distSsr, '__rwjs__rsdw-client.mjs'),
48+
path.join(distSsr, '__cedarjs__rsdw-client.mjs'),
4949
)
5050

5151
return (await import(rsdwClientPath)).default

packages/testing/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ declare global {
4040
var mockGraphQLMutation: typeof mockGqlMutation
4141
var mockGraphQLQuery: typeof mockGqlQuery
4242

43-
var __RWJS__TEST_IMPORTS: {
43+
var __CEDARJS__TEST_IMPORTS: {
4444
apiSrcPath: string
4545
tearDownCachePath: string
4646
}

packages/testing/src/config/jest/api/jest-preset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ const config: Config = {
1717
runner: path.join(__dirname, '../jest-serial-runner.js'),
1818
testEnvironment: path.join(__dirname, './RedwoodApiJestEnv.js'),
1919
globals: {
20-
__RWJS__TEST_IMPORTS: {
20+
__CEDARJS__TEST_IMPORTS: {
2121
apiSrcPath: rwjsPaths.api.src,
2222
tearDownCachePath: path.join(
2323
rwjsPaths.generated.base,
2424
'scenarioTeardown.json',
2525
),
2626
},
2727
},
28-
sandboxInjectedGlobals: ['__RWJS__TEST_IMPORTS'],
28+
sandboxInjectedGlobals: ['__CEDARJS__TEST_IMPORTS'],
2929
displayName: {
3030
color: 'redBright',
3131
name: 'api',

packages/testing/src/config/jest/api/jest.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { defineScenario } from '../../../api/scenario.js'
1515
// testing time
1616
// The key is to reduce the amount of imports in this file, because the
1717
// require.cache is not shared between each test context
18-
const { apiSrcPath, tearDownCachePath } = global.__RWJS__TEST_IMPORTS
18+
const { apiSrcPath, tearDownCachePath } = global.__CEDARJS__TEST_IMPORTS
1919

2020
interface ScenarioData {
2121
[model: string]: {

packages/vite/ambient.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ declare global {
2626
var __REDWOOD__PRERENDER_PAGES: any
2727
var __cedarjs__vite_ssr_runtime: ViteRuntime | undefined
2828
var __cedarjs__vite_rsc_runtime: ViteRuntime | undefined
29-
var __rwjs__client_references: Set<string> | undefined
30-
var __rwjs__server_references: Set<string> | undefined
29+
var __cedarjs__client_references: Set<string> | undefined
30+
var __cedarjs__server_references: Set<string> | undefined
3131

3232
var __REDWOOD__HELMET_CONTEXT: { helmet?: HelmetServerState }
3333

packages/vite/src/__tests__/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ describe('getFullUrl', () => {
3030

3131
it("reads pathname and search parameters from the request's searchParams if they're available", () => {
3232
const req = mockExpressRequest(
33-
'/rw-rsc/__rwjs__Routes?__rwjs__pathname=' +
33+
'/rw-rsc/__cedarjs__Routes?__cedarjs__pathname=' +
3434
encodeURIComponent('/cux/cuux') +
35-
'&__rwjs__search=' +
35+
'&__cedarjs__search=' +
3636
encodeURIComponent('extra=corge'),
3737
)
3838

packages/vite/src/devFeServer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ async function createServer() {
185185

186186
globalThis.__cedarjs__vite_ssr_runtime =
187187
await createViteRuntime(viteSsrDevServer)
188-
globalThis.__rwjs__client_references = new Set<string>()
189-
globalThis.__rwjs__server_references = new Set<string>()
188+
globalThis.__cedarjs__client_references = new Set<string>()
189+
globalThis.__cedarjs__server_references = new Set<string>()
190190

191191
// const clientEntryFileSet = new Set<string>()
192192
// const serverEntryFileSet = new Set<string>()
@@ -296,7 +296,7 @@ async function createServer() {
296296

297297
// TODO (RSC): We need to make sure this `id` always matches what
298298
// vite uses
299-
globalThis.__rwjs__client_references?.delete(id)
299+
globalThis.__cedarjs__client_references?.delete(id)
300300

301301
// If `code` doesn't start with "use client" or 'use client' we can
302302
// skip this file
@@ -309,7 +309,7 @@ async function createServer() {
309309
'adding client reference',
310310
id,
311311
)
312-
globalThis.__rwjs__client_references?.add(id)
312+
globalThis.__cedarjs__client_references?.add(id)
313313

314314
// TODO (RSC): Proper AST parsing would be more robust than simple
315315
// regex matching. But this is a quick and dirty way to get started

0 commit comments

Comments
 (0)