For the first time in decades, the retail space in San Francisco’s historic Ghirardelli Square is nearly full.

Food-focused tenants that have opened in the past year include the Cheese School, which sells cheese and holds classes and events, and San Francisco Brewing Co.’s 12,000-square-foot brewery, beer garden and restaurant. Palette, a new Chinese dim sum venue, is under construction and expected to open in February.

Other recent arrivals include Subpar, a mini golf operator with models of local landmarks, and Compass, the fast-growing real estate brokerage that is expanding its offices. The 100,000-square-foot retail complex is now over 98 percent leased, a big turnaround from just six years ago when nearly half the space was empty.

Property owner Jamestown, an Atlanta real estate developer, credits the property’s success to food and leisure offerings that appeal to local residents as well as tourists who visit nearby Fisherman’s Wharf.

“We’ve seen that local consumer come back,” said Michael Phillips, president of Jamestown. “We’ve tried to really focus on making them our prime customer, and I think that’s been helpful.”

Tenants also tend to specialize in a type of cuisine or retail product that doesn’t compete with their neighbors, he added. “It’s all complementary,” Phillips said.

The property’s namesake, Ghirardelli Chocolate Co., began construction of a factory on the site in the 1890s, but left for San Leandro in the 1960s. Ghirardelli Square was reimagined as a shopping center — Ghirardelli now has several chocolate shops on the premises — and was home to renowned food like Cecilia Chiang’s Mandarin and the Italian restaurant Modesto Lanzone, which both have closed.

Jamestown bought the retail portion of Ghirardelli Square in 2013. Vacancies abounded after a 2010 financial dispute between former owner JMA Ventures and lender Royal Bank of Scotland, which led to foreclosure. JMA continues to manage the upper-floor hotel and timeshare condo portion of Ghirardelli Square with Fairmont Hotels.

Jamestown is no stranger to remaking historic properties. It renovated Atlanta’s Ponce City Market, a former Sears store. It also transformed New York’s Chelsea Market, once a Nabisco factory, into a food hall and offices. Google bought Chelsea Market last year for $2.4 billion in the country’s biggest real estate sale.

The booming economy and tourism have helped Ghirardelli Square, along with a new generation of entrepreneurs. Its neighbor, Fisherman’s Wharf, had 16.4 million visitors in 2017, up from 12 million in 2016, according to San Francisco Travel.

Josh Leavy, owner of San Francisco Brewing Co., said he initially envisioned opening a brewery in southern parts of the city like Dogpatch or near the former Candlestick Park.

He remembers living near Ghirardelli Square and never visiting. “It wasn’t cool 10 years ago,” he said, but he was intrigued by the location because he would have the only brewery on the north side of San Francisco.

There were challenges, such as installing new plumbing, heating and cooling systems while navigating historic permitting requirements. With the hotel situated above the brewery, noise had to be mitigated. Leavy said constructing the brewery cost millions of dollars.

The location has downsides: Workers who commute from the East Bay have to take transit through downtown or Van Ness Avenue, which is grappling with construction delays. The brewery has 55 to 90 employees, depending on the season.

“It’s harder to get people that take public transportation with the whole Van Ness mess going on right now,” Leavy said. “It has been a struggle.”

Leavy is encouraged by the strong patronage of locals. During some weekday happy hours, around 80 percent of patrons are local residents, he said.

Adrienne Gifford of Fresno, visiting Ghirardelli Square on Friday, said it felt spacious and more appealing compared with “overcrowded” Fisherman’s Wharf.

“If I was a local, I would come here,” she said.

Cynthia Sanjaya, who lives in San Francisco’s Chinatown, was eating lunch nearby with a friend who works at the Cheese School.

She called Ghirardelli Square “a touristy place,” but added that recent additions, such as a public movie night last April, appeal to residents.

The Cheese School also attracts locals through classes, reserved in advance, she said. But Sanjaya still sees the Ghirardelli chocolate shops as the biggest draw, mostly for tourists.

Debbie Cardenas, who has lived two blocks away for 25 years, was walking her dog in the square on a recent day. She shops there around twice a month, sometimes buying greeting cards, and brings friends from out of town. A larger coffee shop, though, would draw more locals, she suggested.

Ghirardelli’s transformation has had some setbacks. Award-winning chef Jonathan Waxman opened a restaurant in 2016, but it closed a year later. Palette will now occupy that space.

Both Fisherman’s Wharf and Ghirardelli Square have seen robust new business openings and strong foot traffic in recent years, said Laura Schaefer, community programs and operations director at the Fisherman’s Wharf Community Benefit District, which helps market the area.

She also credits streetscape improvements and work with brokers to attract new businesses and shoppers. The area lacks significant long-term vacant storefronts, she said, unlike neighborhoods such as North Beach and the Castro.

“Ghirardelli Square is a great example of this renaissance,” Schaefer said. “They’re also creating a sense of community.”

Though retail construction is nearing an end at Ghirardelli Square, one major project looms: its 15-foot “Ghirardelli” electrical sign has power failures, and Jamestown is seeking approval for a replica in the next few months. It expects construction to end late this year.

Roland Li is a Chronicle staff writer. Email: roland.li@sfchronicle.com Twitter: @rolandlisf